Logging work with floating point value "4.1h" leads to wrong time display (4h 5m)

XMLWordPrintable

    • 6
    • Severity 3 - Minor

      When I try to log work with the time spent value of "4.1h" I expect the display of the resulting worklog to show 4h 6m. But due to the nature of floating point multiplications in java this is not the case.In my case the JiraDurationUtils class multiplies the long value 3600 by the double value 4.1 which results in something like 14759.9999~ (usually one expects 14760).

      This value (14759) is then stored in the database entry for this worklog and is displayed in the frontend as 4h 5m. While this only steals one minute, it might add up if I have multiple worklogs like that. Am I doing something wrong here?

      Is this behaviour known and if so are there any plans to fix this? I was only able to reproduce it with the value "4.1" but there might be more of these cases.

      Thanks

        1. picture1.png
          37 kB
          jtw-ic
        2. picture2.png
          3 kB
          jtw-ic

            Assignee:
            Unassigned
            Reporter:
            jtw-ic
            Votes:
            7 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: