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

JavaScript Number.prototype.toFixed rounding error before decimal point

    XMLWordPrintable

    Details

    • Commits:
      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

          For Gerrit Dashboard: QTBUG-43885
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              erikv Erik Verbruggen
              Reporter:
              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