NumberToText
New to Analytica 4.5
Note: A preliminary version is included in patch release 4.4.3, but not exposed on menus or in the User Guide. The function included with 4.4 is subject to change.
NumberToText( x, format, digits, showZeroes, thousandsSeparators, currency, dateFormat, fullPrecision )
Convert a number (or date-time number) to text with explicit control over the number format settings. The parameters are similar to those found on the Number Format Dialog.
Parameters
- «format»
- The type of format used for numbers (but not date or date/time values). It can be one of the following values (or just the first letter):
- "Suffix" (39.63K)
- "Exponential" (3.963e+004)
- "Fixed Point" (39632.55)
- "Integer" (39633)
- "Percent" (3963254.89%)
- "Date" (4-Jul-2012) -- forces numbers to display as dates
- "Boolean" (True)
- "Hexadecimal" (0x9ad1)
- «digits»
- The number of significant digits for Suffix and Exponential formats, or the number of digits to the right of the decimal point for Fixed Point and Percent formats.
- «showZeroes»
- Boolean specifying whether to show training zeroes.
- «thousandsSeparators»
- Boolean specifying whether to show separators. In the US, this would be commas between each group of three digits (e.g., 39,632.55).
- «currency»
- Specifies the currency symbol to display, or the symbol and its placement relative to the digits and sign. The following placement templates recognized, where the
$can be replaced by any currency symbol.
- "$-#"
- "$#-"
- "-$#"
- "-#$"
- "#$-"
- "#-$"
- "(#$)"
- "($#)"
- "regional"
- Specifies the currency symbol to display, or the symbol and its placement relative to the digits and sign. The following placement templates recognized, where the
- «dateFormat»
- The template used to display dates, times, or date-time numbers. The following patterns are recognized.
- "SHORT", "ABBREV", "LONG", "TIME", "DATETIME": regional-specific standard formats.
- Y, YY, YYYY: The year. y=two digit, no leading zero. yy=two digits. yyyy=four digits.
- M, MM: The month number, without or with leading zero.
- MMM, MMMM: The month name, abbreviated or full ("Jan" or "January")
- D, DD: The day number, without or with leading zero.
- W: The weekday number
- WWW, WWWW: The weekday name, abbreviated or full ("Wed", or "Wednesday")
- q : The quarter (1 thru 4)
- h, hh: The numeric hour from 1 thru 12, without or with leading zero.
- tt : AM or PM
- H, HH: The numeric hour from 0 thru 23, without or with leading zero.
- m, mm: The numeric number of minutes, from 0 to 59, without or with leading zero.
- s, ss: The whole number portion of seconds, from 0 to 59, without or with leading zero.
- .ssssss: The fractional seconds (up to 6 digits)
- «fullPrecision»
- A boolean value. When set to true, the number is displayed at full precision even if this requires exceeding the number of digits specified in «digits».
See Also
Comments
Enable comment auto-refresher