Apache OpenOffice (AOO) Bugzilla – Issue 7190
recognize units automatically if already there as text if user selects "##unit" mask
Last modified: 2003-10-17 08:00:56 UTC
if the cell already contains "number + unit", specifying a custom mask "## unit" doesn't "do what one would like", because the cell content (was)is text and there is no single number fitting "## unit"; the undelying mask is "## unit" already though. So removing the "text" 'unit' makes the remaining part be number only and the mask is applied showing up as "number unit" in a number mask. It will be better if there is automatic recognition of such text transforming it to "number unit" if unit specified in custom number mask matches the unit text in cell content
Hi Falko, 1 4 u I think this is close to Issue 5658 Frank
.
And how shall we know if 1.0 cm is the same as 1.00 cm ??? There is no failsafe automatismn for what you want ands we already have enough people complaining about our AutoCorretion to be too caretaking.
closed
"traditionalMask customUnit" the question is where to draw the line: which part belongs to the traditional mask and which part is the custom unit. using "##.# °C" the °C in 10.1 °C becomes the unit but not in 9.4 °C if you use # as the indication for the number of places. This is useful when working with CSV data which sometimes comes in the format "data unit" and I don't know an easy way of how to tell Calc that it should only calculate with "data" as number. Regarding your problem: Identify the custom unit (custom text) in a user created mask, then look for (multiple) occurences of this mask in a cell if mask is to be applied on this cell. Then check whether all sourrounding data fits the traditional mask. The first surrounding data which fits is taken as the number, the rest is the unit. When starting from the right hand side for rhs placed units (I don't know whether others are possible), this should be possible.
No I lost you completely! If you define, lets say #,## °C as a user-defined number format and assign it to already existing cell content (such as 1, 2, 3 etc) is will change the content accorsing to the number format. So AFAIKSI it work fine.
the original problem was: cell A1 contains "4 °C" (without quotation marks) and the cell format is text (due to it being a CSV import), which means I can't eg. assign =A1*5 to A2 and get 20 °C in A2. If I choose the cell format # (number) for A1, either I loose the °C or the value becomes sth. weird based on the texts internal number representation -- I can't remember. So I want to assign the cell fomat "# °C". But this results in "4 °C ° C" I think (so adding a °C to the already existing 4 °C in A1). In order to prevent this double unit °C and in order to be able to calculate with the number data 4, I like to have units which are part of a cell format recognized automatically in cells the format is applied on if the units are already present. In order to solve this problem, see my last comment.
Final answer: If you have a cell with 1 °C in it, and you want to be able to treat it like a number you vcan calculate with you must assign a user defined number format like # "°C" That's all. But of course if you INITIAL number format is already text (like inserting a plain 1 °C) than Calc cannot change this string back into a number, even not with the above method. We will not enhance or alter this feature.
Closed.