The FormatNumber() function can be used to convert numeric values into country-specific formats.
The following link describes the formatting:
https://msdn.microsoft.com/de-de/library/0c899ak8(v=vs.110).aspx
Note: FormatNumber() only makes sense if the target element is of type string! When containerizing according to EDIFACT, NullableNumeric data elements are defined with a '.' as a decimal separator.
FormatNumber('Numeric value', 'Formatting', ['Decimal separator or country code'], ['Thousands separator'], ['Default value if the num. Value is empty'])
Code | Result |
---|---|
FormatNumber('2,343.9353', '#,##0.00') | 2,343.94 |
FormatNumber('2,343.9353', '#,##0.00', 'de-DE') | 2.343,94 |
FormatNumber('2,343.9353', '#,##0.00', 'fr-FR') | 2 343,94 |
FormatNumber('2,343.9353', '0.00') | 2343.94 |
FormatNumber('2,343.9353', '0.00', 'de-DE') | 2343,94 |
FormatNumber('2,343.9353', '0.00', 'fr-FR') | 2343,94 |
FormatNumber('10000','#,###.00') | 10,000.00 |
FormatNumber('10000','#,###.#') | 10,000 |
FormatNumber('1.23','#,###.#') | 1.2 |
FormatNumber(2343.9353, '#,##0.00') | 2,343.94 |
FormatNumber('2.343,9353', '#,##0.00') | 2,343.94 |
FormatNumber('2.343,9353', '#,##0.00', '.') | 2343.94 |
FormatNumber('1.23','0,000.00') | 0,001.23 |
FormatNumber('1235.6','#,###.#',',') | 1235,6 |
FormatNumber('1235.6','#,###.00',',') | 1235,60 |
FormatNumber('2.343,9353', '#,##0.00', ',') | 2343,94 |
FormatNumber('2,343.9353', '#,##0.00', ',', '.') | 2.343,94 |
FormatNumber('2,343.9353', '#,##0.00', 'x', ':', '0') | 2:343×94 |
FormatNumber('343,9323', '#,##0.00', ',', '.', '0') | 343,93 |
FormatNumber('2,343.9', '#,##0.00', ',', '') | 2343,90 |
FormatNumber('', '#,##0.00', ',', '.', '0') | 0.00 |
FormatNumber(-12.132, '0.00;0.00-;ZERO') | 12.13- |
FormatNumber(22.9, '0.00;0.00-;ZERO') | 22.90 |
FormatNumber(0, '0.00;0.00-;ZERO') | ZERO |
FormatNumber('', '#,##0.00', ',', '.') | Emtpy |
FormatNumber('-12.132', '#,##0.00+;#,##0.00-', “” , “”) | 1213-1) |
FormatNumber('12.132', '#,##0.00+;#,##0.00-', “” , “”) | 1213+2) |
FormatNumber('2,343.9353', '#,##0.00', '', '') | 234394 |
Note: FormatNumber('1235.6','#,###.00','', '') will result in 123560 3)