Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-74270

Nasty bug in format_float $stripzeros option with zero decimal places

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 3.11.7
    • 3.11.6
    • Libraries, Quiz

      The signature is format_float($float, $decimalpoints=1, $localized=true, $stripzeros=false)

      If you call format_float(100.0, 0, true, true)

      then you get 1, becuase the zeros get stripped form 100. Oops!

      Since MDL-73954, this can cause problems in the quiz. See https://moodle.org/mod/forum/discuss.php?d=432864.

            timhunt Tim Hunt
            timhunt Tim Hunt
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Andrew Lyons Andrew Lyons
            CiBoT CiBoT
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 40 minutes
                40m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.