Comments (5)
Do you have a suggestion about how high the limit should be raised? What are the use cases you're looking at?
Due to implementation concerns, I think we should not go above 255 without a solid use case, and if we have a limit, perhaps something lower like 100 would be reasonable.
from proposal-intl-numberformat-v3.
I have some "numeric calculator". I am using "bigdecimal" library and so do the rounding (to specified number of digits) using the methods of that library (BigDecimal#toFixed(fractionDigits)). I am dealing with minus sign and exponents by my code (as I am trying to use MathML anyway). So NumberFormat need only convert the digits, and so maximumFractionDigits should be 2**53-1 or Infinity.
For now, I can still do the converion in JavaScript itself, as the current NumberFormat allows to get information about digits and decimal separator.
from proposal-intl-numberformat-v3.
The main limitation with maximumFractionDigits is that it gives us a reasonable way to limit the maximum length of the string returned from Intl.NumberFormat. If we were to raise the cap on maximumFractionDigits to something extremely large, it could be a security vulnerability, because it would become easy to make your computer run out of memory.
So in my opinion, it should be fairly harmless to increase the cap to, say, 100, 255, or perhaps a little bit larger if we have a clear use case, but increasing it to an extremely large number or Infinity voids the benefits that the cap serves in the first place.
from proposal-intl-numberformat-v3.
I never needed maximumFractionDigits
to be more than 20 back when I was working in a FinTech company, but I can imagine cases when limit increase could be useful.
https://brilliant.org/wiki/very-small-numbers/ - see "Important Very Small Numbers" part here
from proposal-intl-numberformat-v3.
We decided in the 2021-07-01 meeting to decouple this issue from the NFv3 proposal. tc39/ecma402#585
from proposal-intl-numberformat-v3.
Related Issues (20)
- Intl.PluralRules does not have the [[RoundingMode]] internal slot required by FormatNumericToString HOT 2
- `formatRangeToParts` produces an empty `source` when `FormatApproximately` is used HOT 2
- FormatNumericToString - isNegative first value clarification HOT 2
- Ordinal formating in NumberFormat HOT 2
- useGrouping's Note is inconsistent with the actual code HOT 1
- ResolvePluralRange does not account for approximately formatted ranges HOT 2
- Clarify that literals can be changed in CollapseNumberRange
- Should "approximatelySign" be renamed to "approximateSign"? HOT 1
- Can the order in which properties are read be more comprehensible? HOT 8
- Can ToRawPrecision and ToRawFixed be made more deterministic? HOT 1
- String(Intl)MV should be defined in ECMA-262 HOT 2
- `FormatNumericToString` will errantly convert -0 to +0 then back to -0 before calling `ToRaw[Precision|Fixed]` HOT 1
- Missing 𝔽 subscript for -0 in FormatNumericToString
- Meta: cross-references are gone
- Simplify PartitionNumberRangePattern
- Hard time to implement IntlMathematicalValue HOT 12
- Clarification on what "precision" means in roundingPriority: morePrecision/lessPrecision HOT 4
- Only passing `roundingIncrement` will throw an error. HOT 3
- Limit exponent of intl mathematical value HOT 7
- Lack of [[Source]] in FormatNumericRangeToParts if returned by FormatApproximately HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proposal-intl-numberformat-v3.