TableFormatInvariant
Formats text found in a column in the provided table using the invariant culture.
Syntax
TableFormatInvariant(Table, Column Index,
Format)
Where:
Table The table in which to perform the formatting.
Column Index The column in which to perform the formatting.
Format An Excel formatting string, for example:
- "0000.00" - Formats a number with up to four leading zeroes, and to two decimal places.
- "#.00" - Formats a number to two decimal places.
- "DDDDMMYY-HHMMSS" - Formats a date.
Invariant Culture
The invariant culture is culture-insensitive.
It is particularly important when specifications are run on browsers with different regional cultures.
When text is formatted invariantly the result is consistent across all cultures.
To format a table using the regional culture see TableFormat.
Examples
Example 1
TableFormatInvariant(DWLookupCurrency,4,"MMM-YY")
Will return an array from the Currency table (see Example Data below), with the values in column 4 returned in the month-year format.
| Country | Currency | Rate | Date |
|---|
| France | Euro | 1.3 | Mar-15 |
| United States | Dollar | 1.4 | Feb-15 |
| Germany | Euro | 1.3 | Jan-15 |
| United Kingdom | Pound | 1 | Jul-14 |
DriveWorks will return the table above as an array, which will look like:
| Table returned as an Array |
|---|
| {"Country","Currency","Rate","Date";"France","Euro","1.3","Mar-15";"United States","Dollar","1.4","Feb-15";"Germany","Euro","1.3","Jan-15";"United Kingdom","Pound","1","Jul-14"} |
Example 2
TableFormatInvariant(DWLookupCurrency,3,"0.0%")
Will return an array from the Currency table (see Example Data below), with the values in column 3 formatted as a percentage.
| Country | Currency | Rate | Date |
|---|
| France | Euro | 1.3% | 29/03/15 |
| United States | Dollar | 1.4% | 18/02/15 |
| Germany | Euro | 1.3% | 22/01/15 |
| United Kingdom | Pound | 1.0% | 15/07/14 |
DriveWorks will return the table above as an array, which will look like:
| Table returned as an Array |
|---|
| {"Country","Currency","Rate","Date";"France","Euro","1.3%","29/03/2015";"United States","Dollar","1.4%","18/02/2015";"Germany","Euro","1.3%","22/01/2015";"United Kingdom","Pound","1.0%","15/07/2014"} |
Example Data
Currency Table (DWLookupCurrency)
The original table without any formatting.
| Country | Currency | Rate | Date |
|---|
| France | Euro | 1.3 | 29/03/15 |
| United States | Dollar | 1.4 | 18/02/15 |
| Germany | Euro | 1.3 | 22/01/15 |
| United Kingdom | Pound | 1 | 15/07/14 |
See Also
For more information on formatting strings please see the Microsoft article TEXT function.
Other functions that use the invariant culture
TextInvariant - Formats the given value according to an Excel formatting string using the invariant culture.
TextFormatInvariant - Formats one or more values invariantly according to the given formatting string.
Functions that use regional culture
Text - Formats the given value according to an Excel formatting string.
TextFormat - Formats one or more values according to the given formatting string using .NET framework 4 standard format strings.
TableFormat - Applies a format to all values in a specified column of a table.