Expand description
Formatting for the basic catalog’s functions, in the en-US locale every
reference SDK defaults to: numbers and currency as Intl.NumberFormat
writes them, dates by TR35 pattern, plural categories, and the string forms
JavaScript gives values (String(value)), so output is the same on every
renderer.
Functions§
- format_
currency formatCurrency: the amount with the currency’sen-USsymbol, or its code and a no-break space when it has none; 2 fraction digits unlessdecimalssays otherwise.- format_
date formatDate: a TR35 pattern applied to the date as written (yyyy yy MMMM MMM MM M EEEE E dd d HH H hh h mm ss a), orISOfor the instant in UTC with milliseconds. A value that does not parse gives"".- format_
number formatNumber:en-USdigits with grouping unlessgroupingis false.- number_
string - A number as JavaScript’s
String(number)writes it: shortest round-trip digits, fixed notation between 1e-7 and 1e21, exponential outside. - plural_
category - The plural category of a number in
en:onefor 1,otherotherwise, with the explicit forms every SDK checks first (zerofor 0,onefor 1,twofor 2) when given. - to_
number - A value as JavaScript’s
Number(value)reads it (NaNwhen it is not a number). - to_
string - A value as JavaScript’s
String(value)writes it, with objects and arrays as JSON andnullas""(the specification’s type conversion rule).