Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-43885

JavaScript Number.prototype.toFixed rounding error before decimal point

    XMLWordPrintable

Details

    • c3effc6cd3a66b6c02048d8ad85c7ed3bb3c1463

    Description

      Number.toFixed doesn't round before the decimal point.
      (12.5).toFixed() returns 12. It should return 13.

      Note that rounding after the decimal point is correct:
      (12.05).toFixed(1) yields 12.1.

      In Quick1, the return value is correct.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              erikv Erik Verbruggen
              jbornema Joerg Bornemann
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes