proposal-amount
v20250918.0.0
Published
Polyfill for TC39 Amount proposal
Downloads
10
Maintainers
Readme
proposal-amount: Champion-maintained polyfill for the Amount proposal
This polyfill is intended to match the specification for the Ecma TC39 Amount proposal. See the README there to learn more, including the API. Briefly, the Amount proposal bundles a mathematical value (coming from a digit String, Number, or BigInt) with an optional unit (kilogram, mile, etc) as well as an optional precision, which expresses the number of fractional digits or significant digits that mathematical value is understood as having.
This proposal is intended to match the spec as far as possible. Matching the spec is the main priority; performance is a secondary priority (though since there's rather little that Amount is intedned to do, we don't expect there to be much deviation in the performance of different implementations).
Development
The code is written in TypeScript, with tests in Jest.
Issues
You're welcome to file an issue on GitHub. Before filing an issue, consider whether the unusual behavior you've found might actually be an issue in the underlying spec text. If the spec is right but this code is wrong, then it's an issue for this code. If the spec is wrong, then the code is likely to be "right" insofar as it's supposed to follow the spec text.
