Numbers … big, small, very big, very small … No matter their size, it’s always better if they’re easy to read. In most countries and languages, separator characters are usually used to separate thousands (or tens of thousands) and there is always a character to distinguish the decimal part from the rest of the number. When it’s time to align these numbers correctly in documents, “decimal tabulators” are used (which are based on the decimal separator character of the numbers).
But what if the documents contain numbers from different countries and the numbers aren’t formatted in the right way? Let’s take a closer look at this!
Some word processors assume the most general case: the decimal separator is either a period (aka point) or a comma. If we rely on this and align the numbers according to the first separator encountered from the right, everything will be fine.
Other word processors use what is defined at the system level in the regional parameters.
… Hmmmm … this isn’t so simple after all …
In the first case, large numbers formatted “American” style, such as 123,456,789 (without decimal places), won’t align correctly with 3.1416!
In the second case, “comma” numbers won’t align correctly if the expected decimal separator is a period.
Solution?
To overcome this problem, starting with 4D v18 R5, 4D Write Pro lets you specify this setting for each document. You can choose to align numbers either to:
- the point,
- the comma,
- the first one found,
- or finally, to the separator defined in the operating system.
In order to maximize compatibility (with MS Word in particular) option #3 is chosen by default when creating new documents. When migrating 4D Write documents to 4D Write Pro, the system-defined separator is still chosen by default.
In any case, this option can be modified to adapt to each document. It doesn’t modify the document contents in any way. It only modifies the layout of the content, when displayed.
If you have documents from various sources, this option will probably be of great help! If not, then don’t change anything and everything will continue to work “as before”.
Code sample
As you can see in the sample below, the number containing a point is not correctly aligned:
As long as a comma is defined as the decimal separator in the system, both of the following code samples will give the same result.
WP SET ATTRIBUTES([SAMPLE]WP; wk tab decimal separator; wk system)
//OR
WP SET ATTRIBUTES([SAMPLE]WP; wk tab decimal separator; wk comma)