TEXTTONUMBER

Use TEXTTONUMBER to convert text to a number.

The TONUMBER function provides greater flexibility for specifying the format of the text item that is to be converted to a number.

Syntax:
TEXTTONUMBER ( single-text-expression )
Meaning:
TEXTTONUMBER ( text_to_convert_to_number )
Returns:
A single character number

The text_to_convert_to_number must be in integer or ANSI-formatted (floating point) presentation. The resulting number looks like the input argument, however, nonsignificant zeroes to the right of the decimal separator will be truncated. If the input argument is in error (for example, it is not a recognizable as a valid number), the result is "none".

When specified as in ANSI-formatted presentation, the text string must meet the following requirements:

  • The decimal point can be a period, a comma, or "none".
  • The leading sign can be a plus sign, a minus sign, or "none".
  • No thousands separator is allowed.

Examples

  • TEXTTONUMBER (OrderQty)

    Returns OrderQty as a character number item

Related functions

  • DATETOTEXT
  • FROMNUMBER
  • NUMBERTOTEXT
  • TEXTTODATE
  • TEXTTOTIME
  • TIMETOTEXT