Convert Number to Text

Verb: convertNumberToText

Converts a number to text according to the Conversion type and the Language selected.

Syntax

convertNumberToText --number(Numeric) --conversiontype(ConversionType) --decimals(Numeric) [--usethousandseparator(Boolean)] [--culture(Culture)] (String)=value

Inputs

Script Designer Required AcceptedTypes Description
--number Number to convert Required Number Number that should be converted.
--conversiontype Conversion type Required ConversionType Type of conversion to text. Options:
  • Extended money (i.e. one dollar)
  • Extended number (i.e. 1634 = one thousand, six hundred and thirty four)
  • Extended percentage (i.e. 0.25 = twenty-five percent)
  • Money (i.e. $1)
  • Number (i.e. 2.14)
  • Percentage (i.e. 0.25 = 25%)
  • --decimals Decimal places Only whenConversion type is SimpleNumber, ExtendedNumber, SimplePercentage, ExtendedPercentage Number Number of decimal places to consider after conversion.
    --usethousandseparator Use thousands separator Optional Boolean Sets whether the result returns with thousands separator.
    --culture Language Optional Culture Changes the punctuation of the result according to the selected language. Options:
  • de-DE
  • en-US
  • es-ES
  • ko-KR
  • pt-BR
  • pt-PT
  • zh-CN
  • zh-TW

  • 1. Diferentiates a period "." from a comma "," separating the decimal places and the thousand separator.
    2. Changes the currency symbol according to language selection.

    Outputs

    Script Designer AcceptedTypes Description
    value Text Text Converted text.

    Example

    A variable with the value 5.25 is defined, with Conversion type set as "Money" and Language as "English (United States)" to convert this number to text.

    defVar --name numberConverted --type String
    defVar --name numberToConverter --type Numeric
    setVar --name "${numberToConverter}" --value "5.25"
    convertNumberToText --number ${numberToConverter} --conversiontype "SimpleMoney" --culture en-US numberConverted=value
    logMessage --message "${numberConverted}" --type "Info"
    // Result:
    // $ 5.25
    

    Remarks

    In the Conversion type parameter, if the selected type is "Money", two decimal places are considered for cents. If it is "Number", the parameter Decimal places must be filled, or only the integer part of the value is considered.

    See Also

  • Convert Text to Number
  • Decrement Variable
  • Evaluate
  • Generate Random Number
  • Increment Variable
  • Solve Linear Equations
  • Solve Linear Optimization Problem
  • Truncate Number