#### ToText

##### ToText (Integer a, String b)

This function converts a BigInt value to a String.

Parameters

- a - A BigInt value to be converted.
- b - A String value indicating the format for displaying the value in argument a.

Return value

The return value is a String.

Example

The return value of the following statement is 456.

`ToText(456, "###")`

##### ToText (Integer a, String b, Integer c)

This function converts a BigInt value to a String.

Parameters

- a - A BigInt value to be converted.
- b - A String indicating the format for displaying the value in a.
- c - The number of decimal places to be converted.

Return value

The return value is a String.

Example

The return value of the following statement is 456.00.

`ToText(456, "###", 2)`

##### ToText(Integer a)

This function converts a BigInt value to a String.

Parameter

a - A BigInt value to be converted.

Return value

The return value is a String.

Example

The return value of the following statement is 456.

`ToText(456)`

##### ToText(Currency a, String b, Integer c, String d, String e)

This function converts a Currency value to a String.

Parameters

- a - A Currency value to be converted.
- b - A String indicating the format for displaying the value in a.
- c - The number of decimal places to be converted.
- d - A single character string indicating the character to be used to separate thousands in a.
- e - A single character string indicating to be used as a decimal separator.

Return value

The return value is a String.

Examples

- The return value of the following statement is $4,567.123.

  `ToText($4567.123, "$#,##0.00", 3, "," , ".")`

- The return value of the following statement is $4&567*1.

  `ToText($4567.123, "$#,##0.00", 1, "&", "*")`

##### ToText(Currency a, String b, Integer c, String d)

This function converts a Currency value to a String.

Parameters

- a - A Currency value to be converted.
- b - A String indicating the format for displaying the value in a.
- c - The number of decimal places to be converted.
- d - A single character string indicating the character to be used to separate thousands in a.

Return value

The return value is a String.

Example

The return value of the following statement is $1*234.57.

`ToText($1234.57, "$#,###.000", 2, "*")`

##### ToText(Number a, String b)

This function converts a Double value to a String.

Parameters

- a - A Double value to be converted.
- b - A String indicating the format for displaying the value in a.

Return value

The return value is a String.

Example

The return value of the following statement is 1236.46.

`ToText(1236.456, "###0.00")`

##### ToText(Number a, Integer c, String d)

This function converts a Double value to a string.

Parameters

- a - A Double value to be converted.
- c - The number of decimal places to be converted.
- d - A single character string indicating the character to be used to separate thousands in a.

Return value

The return value is a String.

Example

The return value of the following statement is 1,234.6.

`ToText(1234.567, 1, ",")`

##### ToText(Number a, Integer c, String d, String e)

This function converts a Double value to a String.

Parameters

- a - A Double value to be converted.
- c - The number of decimal places to be converted.
- d - A single character string indicating the character to be used to separate thousands in a.
- e - A single character string indicating to be used as a decimal separator.

Return value

The return value is a String.

Example

The return value of the following statement is 1,234,57.

`ToText(1234.567, 2, "," , ",")`

##### ToText(Integer a, Integer c, String d)

This function converts a BigInt value to a String.

Parameters

- a - A BigInt value to be converted.
- c - The number of decimal places to be converted.
- d - A single character string indicating the character to be used to separate thousands in a.

Return value

The return value is a String.

Example

The return value of the following statement is 1,234.00.

`ToText(1234, 2, ",")`

##### ToText(Currency a, String b, Integer c)

This function converts a Currency value to a String.

Parameters

- a - A Currency value to be converted.
- b - A String indicating the format for displaying the value in a.
- c - The number of decimal places to be converted.

Return value

The return value is a String.

Example

The return value of the following statement is $123.5.

`ToText($123.456, "$##0.00", 1)`

##### ToText(Number a)

This function converts a Double value to a String.

Parameter

a - A Double value to be converted.

Return value

The return value is a String.

Example

The return value of the following statement is 123.456.

`ToText(123.456)`

##### ToText(Time a, String b)

This function converts a Time value to a String.

Parameters

- a - A Time value to be converted.
- b - A String that defines how the value in a to be formatted.

Return value

The return value is a String.

Example

Suppose the time is 08:48:58, the return value of the following statement is 8:48:58.

`ToText(ToTime(8,48,58), "h:mm:ss")`

##### ToText(Time a, String b, String c)

This function converts a Time value to a String.

Parameters

- a - A Time value to be converted.
- b - A String that defines how the value in a to be formatted.
- c - A String to be used as a label for A.M. (morning) hours.

Return value

The return value is a String.

Example

Suppose the time is 8:48:58 in the morning, the return value of the following statement is 8:48:58 AM.

`ToText(ToTime(8,48,58), "h:mm:ss a", "AM")`

##### ToText(Time a, String b,String c, String d)

This function converts a Time value to a String.

Parameters

- a - A Time value to be converted.
- b - A String that defines how the value in a to be formatted.
- c - A String to be used as a label for A.M. (morning) hours.
- d - A String to be used as a label for P.M. (evening) hours.

Return value

The return value is a String.

Examples

- Suppose the time is 08:48:58, the return value of the following statement is 8:48:58 AM.

  `ToText(ToTime(8,48,58), "h:mm:ss a", "AM", "PM")`

- Suppose the time is 21:49:59, the return value of the following statement is 9:49:59 PM.

  `ToText(ToTime(21,49,59), "h:mm:ss a", "AM", "PM")`

##### ToText(DateTime a)

This function converts a DateTime value to a String.

Parameter

a - A TimeStamp value to be converted.

Return value

The return value is a String.

Example

Suppose the date is July 15,1999 and time is 7:42:51, the return value of the following statement is 15-Jul-99 7:42:51 AM.

`ToText(ToDateTime(1999,7,15,7,42,51))`

##### ToText(DateTime a, String b)

This function converts a DateTime value to a String.

Parameters

- a - A TimeStamp value to be converted.
- b - A String that defines how the DateTime value in a to be formatted.

Return value

The return value is a String.

Example

Suppose the date is July 15,1999 and time is 7:42:51, the return value of the following statement is 07-15-99 7:42:51.

`ToText(ToDateTime(1999,7,15,7,42,51), "MM-dd-yy h:mm:ss")`

##### ToText(DateTime a, String b, String c)

This function converts a DateTime value to a String.

Parameters

- a - A TimeStamp value to be converted.
- b - A String that defines how the DateTime value in a to be formatted.
- c - A String to be used as a label for A.M. (morning) hours.

Return value

The return value is a String.

Example

Suppose the date is July 15,1999 and time is 7:42:51, the return value of the following statement is 15-Jul-99 7:42:51 AM.

`ToText(ToDateTime(1999,7,15,7,42,51), "dd-MMM-yy h:mm:ss a", "AM")`

##### ToText(DateTime a, String b, String c, String d)

This function converts a DateTime value to a String.

Parameters

- a - A TimeStamp value to be converted.
- b - A String that defines how the DateTime value in a to be formatted.
- c - A String to be used as a label for A.M. (morning) hours.
- d - A String to be used as a label for P.M. (evening) hours.

Return value

The return value is a String.

Examples

- Suppose the date is Oct. 7,1999 and time is 7:42:51, the return value of the following statement is 07-Oct-99 7:42:51 AM.

  `ToText(ToDateTime(1999,10,7,7,42,51), "dd-MMM-yy h:mm:ss a", "AM", "PM")`

- Suppose the date is Oct. 7,1999 and time is 18:42:51, the return value of the following statement is 07-Oct-99 6:42:51 PM.

  `ToText(ToDateTime(1999,10,7,18,42,51), "dd-MMM-yy h:mm:ss a","AM", "PM")`

##### ToText(Integer a, Integer c, String d, String e)

This function converts a BigInt value to a String.

Parameters

- a - A BigInt value to be converted.
- c - The number of decimal places to be converted.
- d - A single character string indicating the character to be used to separate thousands in a.
- e - A single character string indicating to be used as a decimal separator.

Return value

The return value is a String.

Example

The return value of the following statement is 12,345.00.

`ToText(12345, 2, ",", ".")`

##### ToText(Currency a, String b)

This function converts a Currency value to a String.

Parameters

- a - A Currency value to be converted.
- b - A String indicating the format for displaying the value in a.

Return value

The return value is a String.

Example

The return value of the following statement is $123.45.

`ToText($123.45, "$##0.00")`

##### ToText(Integer a, Integer c)

This function converts a BigInt value to a String.

Parameters

- a - A BigInt value to be converted.
- c - The number of decimal places to be converted.

Return value

The return value is a String.

Example

The return value of the following statement is 123.00.

`ToText(123, 2)`

##### ToText(Currency a, Integer c, String d)

This function converts a Currency value to a String.

Parameters

- a - A Currency value to be converted.
- c - The number of decimal places to be converted.
- d - A single character string indicating the character to be used to separate thousands in a.

Return value

The return value is a String.

Example

The return value of the following statement is $1,234.57.

`ToText($1234.567, 2, ",")`

##### ToText(Currency a, Integer c)

This function converts a Currency value to a String.

Parameters

- a - A Currency value to be converted.
- c - The number of decimal places to be converted.

Return value

The return value is a String.

Example

The return value of the following statement is $123.46.

`ToText($123.4567, 2)`

##### ToText(Number a, Integer c)

This function converts a Double value to a String.

Parameters

- a - A Double value to be converted.
- c - The number of decimal places to be converted.

Return value

The return value is a String.

Example

The return value of the following statement is 123.46.

`ToText(123.456, 2)`

##### ToText(Currency a, Integer c, String d,String e)

This function converts a Currency value to a String.

Parameters

- a - A currency value to be converted.
- c - The number of decimal places to be converted.
- d - A single character string indicating the character to be used to separate thousands in a.
- e - A single character string indicating to be used as a decimal separator.

Return value

The return value is a String.

Example

The return value of the following statement is $1,234.57.

`ToText($1234.567, 2, ",", ".")`

##### ToText(Date a)

This function converts a Date value to a String.

Parameter

a - A Data value.

Return value

The return value is a String.

Example

Suppose the date is July 15,1999, the return value of the following statement is 15-Jul-99.

`ToText(ToDate(1999,7,15))`

##### ToText(Currency a)

This function converts a Currency value to a String.

Parameter

a - A Currency value to be converted.

Return value

The return value is a String.

Example

The return value of the following statement is $123.45.

`ToText($123.45)`

##### ToText(Bit a)

This function converts a Bit value to a String, either true or false.

Parameter

a - A Bit value.

Return value

The return value is a String.

Example

The return value of the following statement is false.

`ToText(3<2)`

##### ToText(Date a, String b)

This function converts a Date value to a String.

Parameters

- a - A Date value.
- b - A String that defines how the Data value in a to be formatted.

Return value

The return value is a String.

Example

Suppose the date is July 15,1999, the return value of the following statement is 15-Jul-99.

`ToText(ToDate(1999,7,15), "dd-MMM-yy")`

##### ToText(Time a)

This function converts a Time value to a String.

Parameter

a - A Time value.

Return value

The return value is a String.

Example

Suppose the time is 12:40:30, the return value of the following statement is 12:40:30 PM.

`ToText(ToTime(12,40,30))`

##### ToText(Number a, String b, Integer c, String d)

This function converts a Double value to a String.

Parameters

- a - A Double value to be converted.
- b - A String indicating the format for displaying the value in a.
- c - The number of decimal places to be converted.
- d - A single character string indicating the character to be used to separate thousands in a.

Return value

The return value is a String.

Example

The return value of the following statement is 1,234.57.

`ToText(1234.567, "#,###.000", 2, ",")`

##### ToText(Integer a, String b, Integer c, String d, String e)

This function converts a BigInt value to a String.

Parameters

- a - A BigInt value to be converted.
- b - A String indicating the format for displaying the value in a.
- c - The number of decimal places to be converted.
- d - A single character string indicating the character to be used to separate thousands in a.
- e - A single character string indicating to be used as a decimal separator.

Return value

The return value is a String.

Example

The return value of the following statement is 1,234.00.

`ToText(1234, "#,###", 2, ",", ".")`

##### ToText(Number a, String b, Integer c)

This function converts a Double value to a String.

Parameters

- a - A Double value to be converted.
- b - A String indicating the format for displaying the value in a.
- c - The number of decimal places to be converted.

Return value

The return value is a string.

Example

The return value of the following statement is 123.46.

`ToText(123.456, "###.00", 2)`

##### ToText(Integer a, String b, Integer c, String d)

This function converts a BigInt value to a String.

Parameters

- a - A BigInt value to be converted.
- b - A String indicating the format for displaying the value in a.
- c - The number of decimal places to be converted.
- d - A single character string indicating the character to be used to separate thousands in a.

Return value

The return value is a String.

Example

The return value of the following statement is 1,234.00.

`ToText(1234, "#,###", 2, ",", ".")`

##### ToText(Number a, String b, Integer c, String d,String e)

This function converts a Double value to a String.

Parameters

- a - A Double value to be converted.
- b - A String indicating the format for displaying the value in a.
- c - The number of decimal places to be converted.
- d - A single character string indicating the character to be used to separate thousands in a.
- e - A single character string indicating to be used as a decimal separator.

Return value

The return value is a String.

Example

The return value of the following statement is 1,234.57.

`ToText(1234.567, "#,###.000", 2, ",", ".")`

Notes:

- When converting a Double value, Currency value or a BigInt value to a String, special characters used as format in argument b are following:

  Symbol | Meaning | Notes
  --- | --- | ---
  0 | a digit |
  * | a digit, zero shows as a star | Can't mix 0, *, and _ in same format
  _ | a digit, zero shows as a space | Can't mix 0, *, and _ in same format
  # | a digit, zero shows as absent |
  . | placeholder for decimal separator |
  , | placeholder for grouping delimiter | Shows the interval to be used
  ; | separates formats | positive and negative.
  - | if there is no explicit negative sign, - is prefixed | "0.00" -> "0.00;-0.00"
  % | divide by 100 and show as percentage |
  X | any other characters can be used in the prefix or suffix |

- Time format syntax: The time format is specified by means of a String time pattern. In this pattern, all ASCII letters are reserved as pattern letters, which are defined as the following:

  Symbol | Meaning | Presentation | Example
  --- | --- | --- | ---
  G | era designator | Text | AD
  y | year | Number | 1996
  M | month in year | Text & Number | July & 07
  d | day in month | Number | 10
  h | hour in am/pm (1~12) | Number | 12
  H | hour in day (0~23) | Number | 0
  m | minute in hour | Number | 30
  s | second in minute | Number | 55
  S | millisecond | Number | 978
  E | day in week | Text | Tuesday
  D | day in year | Number | 189
  F | day of week in month | Number | 2 (2nd Wed in July)
  w | week in year | Number | 27
  W | week in month | Number | 2
  a | am/pm marker | Text | PM
  k | hour in day (1~24) | Number | 24
  K | hour in am/pm (0~11) | Number | 0
  z | time zone | Text | Pacific Standard Time
  ' | escape for text |  |
  '' | single quote |  |