?u/p1-90`This specification consists of two parts:
The changes proposed here are stacked on top of the Keep Trailing Zeros ECMA-402 proposal, and include calls to ECMA-402 Abstract Operations from ECMA-262 algorithms. Where necessary, we intend to promote those semantics to ECMA-262.
An Amount is an object that wraps a numeric value—as a Number, BigInt, or String—together with an optional unit (e.g., mile, kilogram, EUR, JPY, USD-per-mile). One can intuitively understand an Amount as a value that, so to speak, knows what it is measuring.
When precision options (such as fractionDigits or significantDigits) are applied, or when unit conversion is performed, the numeric value is stored as a decimal digit string, which
Rounding a
The abstract operation GetOption takes arguments options (an Object), property (a
The abstract operation GetAmountOptions takes argument opts (an Object) and returns either a
The abstract operation GetAmountConvertToOptions takes argument opts (an Object) and returns either a
The abstract operation CreateFormatterObject takes arguments roundingMode (a String), minFractionDigits (a non-negative
Unit conversion data is derived from CLDR file units.xml. As described in Unicode Technical Standard #35 Part 6 Supplemental, Conversion Data, each <convertUnit> element defines how to convert a source unit into a compatible baseUnit. An ECMAScript implementation must ignore all special conversions and support all conversions based on factor and/or offset, interpreting the value for each as an arithmetic expression with baseUnit).
Two units are convertible if and only if they share the same baseUnit value in CLDR. A unit that appears as a baseUnit value has an implicit identity conversion (factor 1, offset 0).
In factor and offset expressions, * multiplication binds more tightly than / division, and constants defined by <unitConstant> elements are valid operands.
For example:
<convertUnit source='celsius' baseUnit='kelvin' offset='273.15' systems="si metric"/> specifies that conversion from unit "celsius" to unit "kelvin" requires addition of 273.15.<convertUnit source='fahrenheit' baseUnit='kelvin' factor='5/9' offset='2298.35/9' systems="ussystem uksystem"/> specifies that conversion from unit "fahrenheit" to unit "kelvin" requires multiplication by (5 / 9) followed by addition of (2298.35 / 9).<convertUnit source='radian' baseUnit='revolution' factor='1/2*PI' systems="si metric"/> specifies that conversion from unit "radian" to unit "revolution" requires multiplication by (1 / (2 × PI)), which references <unitConstant constant="PI" value="411557987 / 131002976" status='approximate'/> and is thus equivalent to multiplication by (1 / (2 × (411557987 / 131002976))) = (131002976 / 823115974).<convertUnit source='solar-mass' baseUnit='kilogram' factor='1.98847E+30' systems="astronomical"/> specifies that conversion from unit "solar-mass" to unit "kilogram" requires multiplication by (1.98847 × 1030).The abstract operation GetUnitConversionFactor takes argument unit (a String) and returns either a
source of a <convertUnit> element in the <convertUnit> element.special, throw a baseUnit of element.factor attribute of element if present, or 1 otherwise.offset attribute of element if present, or 0 otherwise.baseUnit value in the The formula for converting a value in unit to its base unit is: baseValue = value × [[Factor]] + [[Offset]].
The abstract operation ConvertUnitValue takes arguments value (a Number), sourceUnit (a String), and targetUnit (a String) and returns either a
The factor term sourceFactor / targetFactor and the offset term (sourceOffset − targetOffset) / targetFactor are computed as
The Amount
When no precision options are given, Number and BigInt arguments are stored directly in [[AmountValue]], preserving the original type. String arguments are normalized to StrDecimalLiteral form. When precision options are specified, [[AmountValue]] always holds a String.
We intend to move 402's
This
The value may be a Number, BigInt, or String. It
This
This method returns a String representation of the Amount, including a unit indicator in bracket notation.
It performs the following steps when called:
An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement this method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of this method is used:
It performs the following steps when called:
The meanings of the optional parameters to this method are defined in the ECMA-402 specification; implementations that do not include ECMA-402 support must not use those parameter positions for anything else.
This method returns a new Amount whose value is the result of converting this Amount’s value from its current unit to a target unit. The target unit is specified by options.
It performs the following steps when called:
This section lists amendments which must be made to ECMA-402, the ECMAScript® 2024 Internationalization API Specification.
Text to be added is marked like this, and text to be deleted is marked like this.
Blocks of unmodified text between modified sections are marked by [...].
This definition supersedes the definition provided in es2025,
This function performs the following steps when called:
The following entry is to be added to ECMA-402's list of referenced parts of Unicode Technical Standard #35.
The abstract operation GetNumberFormatPattern takes arguments numberFormat (an Intl.NumberFormat) and x (an
The abstract operation SetNumberFormatUnitOptions takes arguments intlObj (an Intl.NumberFormat) and options (an Object) and returns either a
© 2026 Ben Allen, Jesse Alama
All Software contained in this document ("Software") is protected by copyright and is being made available under the "BSD License", included below. This Software may be subject to third party rights (rights from parties other than Ecma International), including patent rights, and no licenses under such third party rights are granted under this license even if the third party concerned is a member of Ecma International. SEE THE ECMA CODE OF CONDUCT IN PATENT MATTERS AVAILABLE AT https://ecma-international.org/memento/codeofconduct.htm FOR INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO IMPLEMENT ECMA INTERNATIONAL STANDARDS.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ECMA INTERNATIONAL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.