Returns a table with number formats converted from one culture to another.
SppConvertNumberCultureInTable([TableArray],[SourceCulture],[TargetCulture],[ExcludeHeader][ColumnNumber])
Where:
TableArray is the table to convert from the source culture to the target culture. A table array can be the data in a standard table or the result of a QueryDataValues function for example.
SourceCulture is the culture of the current number (for example fr-FR for French France). Will default to the current culture if left blank.
TargetCulture is the culture to convert the value to (for example en-US for English US). Will default to the current culture if left blank.
ExcludeHeader should be set to True to exclude the header, or False to also format the header row.
ColumnNumber is the index of the column to convert numbers in. The function will convert numbers in the entire table if this argument is left blank or is set to 0 or a value bigger than the total number of columns.
Rule | Result | Meaning |
---|---|---|
SppConvertNumberCultureInTable(DWLookupProducts, "en-GB", "de-DE", TRUE) | {"ID","Name","Value","Rate";"1","Product A","24,99","1,5";"2","Product B","13","8,7";"3","Product C","8200","10,6";"4","Product D","123","4,8";"5","Product E","3141,59","2,32"} | Will return a new Array where numbers, initially formatted with an English number formatting are now following a German number formatting. Numbers in the header row being excluded. |
SppConvertNumberCultureInTable(DWLookupProducts, "en-US", "fr-FR", FALSE, 3) | {"ID","Name","Value","Rate";"1","Product A","24,99","1.50";"2","Product B","13","8.70";"3","Product C","8200","10.60";"4","Product D","123","4.80";"5","Product E","3141,59","2.32"} | Will return a new table where numbers in the third column, initially formatted with English formatting are now following a French number formatting. |
SourceCulture and TargetCulture can be defined by referring to the Table of Language Culture Names from Microsoft.
ID | Name | Value | Rate |
---|---|---|---|
1 | Product A | 24.99 | 1.50 |
2 | Product B | 13.00 | 8.70 |
3 | Product C | 8200.00 | 10.60 |
4 | Product D | 123.00 | 4.80 |
5 | Product E | 3141.59 | 2.32 |
ID | Name | Value | Rate |
---|---|---|---|
1 | Product A | 24,99 | 1,50 |
2 | Product B | 13 | 8,7 |
3 | Product C | 8200 | 10,6 |
4 | Product D | 123 | 4,8 |
5 | Product E | 3141,59 | 2,32 |
This function can be used for two main use-cases: