Phait
12-05-2007, 08:47 AM
In OO Calc, where the fookin' fook do you tell it NOT to replace numbers you type with leading zeros?
Ex. I type: 01 it changes it to just '1'. DO NOT WANT.
I poked around in the options - they do have a table of word/character replacement, but nothing pertaining to leading zeros. In the View options for Calc, theres a bit that is checked on, it says to display "zero values". I assume this is it? Anyway, it is by default checked, but doesn't fix this.
The help file says:
There are various ways to enter integers starting with a zero:
Enter the number as text. The easiest way is to enter the number starting with an apostrophe (for example, '0987). The apostrophe will not appear in the cell, and the number will be formatted as text. Because it is in text format, however, you cannot calculate with this number.
Format a cell with a number format such as \0000. This format can be assigned in the Format code field under the Format - Cells - Numbers tab, and defines the cell display as "always put a zero first and then the integer, having at least three places, and filled with zeros at the left if less than three digits".
If you want to apply a numerical format to a column of numbers in text format (for example, text "000123" becomes number "123"), do the following:
1.Select the column in which the digits are found in text format. Set the cell format in that column as "Number".
2.Choose Edit - Find & Replace
3.In the Search for box, enter ^[0-9]
4.In the Replace with box, enter &
5.Check Regular expressions
6.Check Current selection only
7.Click Replace All
Fine, but I just want it to use leading zeros by default.
Ex. I type: 01 it changes it to just '1'. DO NOT WANT.
I poked around in the options - they do have a table of word/character replacement, but nothing pertaining to leading zeros. In the View options for Calc, theres a bit that is checked on, it says to display "zero values". I assume this is it? Anyway, it is by default checked, but doesn't fix this.
The help file says:
There are various ways to enter integers starting with a zero:
Enter the number as text. The easiest way is to enter the number starting with an apostrophe (for example, '0987). The apostrophe will not appear in the cell, and the number will be formatted as text. Because it is in text format, however, you cannot calculate with this number.
Format a cell with a number format such as \0000. This format can be assigned in the Format code field under the Format - Cells - Numbers tab, and defines the cell display as "always put a zero first and then the integer, having at least three places, and filled with zeros at the left if less than three digits".
If you want to apply a numerical format to a column of numbers in text format (for example, text "000123" becomes number "123"), do the following:
1.Select the column in which the digits are found in text format. Set the cell format in that column as "Number".
2.Choose Edit - Find & Replace
3.In the Search for box, enter ^[0-9]
4.In the Replace with box, enter &
5.Check Regular expressions
6.Check Current selection only
7.Click Replace All
Fine, but I just want it to use leading zeros by default.