Coder Social home page Coder Social logo

Comments (5)

sffc avatar sffc commented on September 23, 2024

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.

Yaffle avatar Yaffle commented on September 23, 2024

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.

sffc avatar sffc commented on September 23, 2024

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.

chicoxyzzy avatar chicoxyzzy commented on September 23, 2024

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.

sffc avatar sffc commented on September 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.