format numeric quote based on selected region and specified decimal length
shortens large numbers with locale-appropriate compact units (CLDR):
e.g. en 1.23M / 1B, de 1,23 Mio. / 1 Mrd..
As in v3, when 0 decimals are requested but the value is large enough to take
a compact unit, two decimals are shown anyway (e.g. formatQuote(1_000_000, 0)
=> "1.00M"); values too small to be abbreviated keep 0 decimals ("999").
The compact part is present in the formatted output iff a unit was applied.
NOTE: CLDR decides the abbreviation thresholds and digits, so output uses the
locale's native numbering system and German does not abbreviate thousands.
Parameters
n: number
number to be formatted
d: number
exact digits (0 becomes 2 when the value takes a compact unit)
format numeric quote based on selected region and specified decimal length
shortens large numbers with locale-appropriate compact units (CLDR): e.g. en
1.23M/1B, de1,23 Mio./1 Mrd..As in v3, when 0 decimals are requested but the value is large enough to take a compact unit, two decimals are shown anyway (e.g.
formatQuote(1_000_000, 0)=>"1.00M"); values too small to be abbreviated keep 0 decimals ("999"). Thecompactpart is present in the formatted output iff a unit was applied.NOTE: CLDR decides the abbreviation thresholds and digits, so output uses the locale's native numbering system and German does not abbreviate thousands.