Home Search

DriveWorks Solo 24
TableFormat

Send Feedback

TableFormat

Formats text found in a column in the provided table.

Syntax

TableFormat(Table, Column Index, Format)

Where:

Table is the table in which to perform the formatting.

Column Index is the column in which to perform the formatting.

Format is an Excel formatting string, for example:

  1. "0000.00" - Formats a number with up to four leading zeroes, and to two decimal places.
  2. "#.00" - Formats a number to two decimal places.
  3. "DDDDMMYY-HHMMSS" - Formats a date.
  4. "0%" or "0.0%" - Formats the table column as a percentage (0.0% requires the same quantity of decimal places as the text being formatted).

Regional Culture

This function uses the regional culture of the system it is used on to format the output.

For example the rule:

TableFormat(DwLookupTable,2,"hh:mm:ss")

Will return 11:05:25 for some regional cultures.

And 11.05.25 for other regional cultures.

To format text in a table using the invariant culture see TableFormatInvariant.

Examples

RuleMeaning
TableFormat(DWLookupCurrency,4,"MMM-YY")Will return an array from the table Data, with the values in column 4 formatted as a date. See Example Outcome 1 below.
TableFormat(DWLookupCurrency,3,"0.0%")Will return an array from the table Data, with the values in column 3 formatted as a percentage. See Example Outcome 2 below.

Example Data

Currency Table

CountryCurrencyRateDate
FranceEuro1.329/03/15
United StatesDollar1.418/02/15
GermanyEuro1.322/01/15
United KingdomPound115/07/14

Example Outcome 1

Currency Table

CountryCurrencyRateDate
FranceEuro1.3Mar-15
United StatesDollar1.4Feb-15
GermanyEuro1.3Jan-15
United KingdomPound1Jul-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 Outcome 2

Currency Table

CountryCurrencyRateDate
FranceEuro1.3%29/03/15
United StatesDollar1.4%18/02/15
GermanyEuro1.3%22/01/15
United KingdomPound1.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"}