KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Changes to Numeric Format strings
PRODUCT: 4D | VERSION: 12 | PLATFORM: Mac & Win
Published On: July 26, 2010

When converting a database from 4D 2004 (or earlier) to 4D v11 SQL or 4D v12, a change in how the newer versions handle format strings is important to note. In the 4D v11 SQL Upgrade Manual the following paragraph announced the change in how format strings are handled. In 4D versions prior to version 11, it was up to the developer to set format strings to the correct regional settings.

System Preferences for Numbers
From now on, in 4D v11 SQL databases, numeric display formats are automatically based on regional system parameters. 4D automatically replaces the "." and "," characters in numeric display formats by, respectively, the thousand separator and the decimal separator defined in the operating system. The period and comma are thus considered as placeholder characters, following the example of 0 or #.

Format strings formatted for the US will appear correctly whether the preference is checked or not. If the strings are formatted for regions other than the US (French, German, etc.) and the option is not checkedb an error string (<<<<<<<<<<) will appear in the form object instead of a properly formatted number.

In a database converted to 4D v11 SQL, the preference appears as shown in the image below.



In a database converted to 4D v12, the preference appears as shown below.



In new databases in 4D v11 SQL and 4D v12, this preference is not present and the US regional format strings must be used.