# PointOrCommaSeparator_to_SystemSeparator ( _input ; _resultAsText ; _4to6withSepAsDecimal )

For numbers (with or without unit) coming from a text string, sometimes you don't know which decimal or thousands separator was used in the input. This CF converts the found decimal separators and thousands separators to the ones given by the system. The CF outputs either a text string that retains units or a number.

 Udo Bösch - Show more from this author Udo R. Bösch mipiano apps http://mipiano.de

Sample input:
PointOrCommaSeparator_to_SystemSeparator ( "1,12" ; 0 ; 0 )
PointOrCommaSeparator_to_SystemSeparator ( "1.12 EUR" ; 0 ; 1 )
PointOrCommaSeparator_to_SystemSeparator ( "1,123 g" ; 1 ; 0 )
PointOrCommaSeparator_to_SystemSeparator ( "1,123 kg" ; 1 ; 1 )
PointOrCommaSeparator_to_SystemSeparator ( "12.123 EUR" ; 1 ; 0 )
PointOrCommaSeparator_to_SystemSeparator ( "12.123 USD" ; 1 ; 1 )
Sample output:
1.12 (e.g. in the US), 1,12 (in Germany)
1.12 (e.g. in the US), 1,12 (in Germany)
"1,123 g" (e.g. in the US), "1.123 g" (in Germany)
"1.123 kg" (e.g. in the US), "1,123 kg" (in Germany)
"12,123 EUR" (e.g. in the US), "12.123 EUR" (in Germany)
"12.123 USD" (e.g. in the US), "12,123 EUR" (in Germany)

Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

• PURPOSE:
For numbers (with or without unit) coming from a text string, sometimes you don't know which decimal or thousands separator was used in the input.
This CF converts the found decimal separators and thousands separators to the ones given by the system.
The CF outputs either a text string that retains units or a number.

• PARAMETERS:
_input : your string or number

_resultAsText :
1 = the result is a text string that retains a given unit
0 = the result is only the decimal number

_4to6withSepAsDezimal : (only affects 4- to 6-digit numbers)
1 = the separator will be interpreted as decimal separator
0 = the separator will be interpreted as thousands separator

• LIMITATIONS:
You must decide for your situation how 4- to 6-digit numbers containing a separator will be handled: Should the separator be interpreted as a decimal separator or as a thousands separator.