Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-41907

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

      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
          picture1.png
          37 kB
        2. picture2.png
          picture2.png
          3 kB

              Unassigned Unassigned
              f623528f4871 jtw-ic
              Affected customers:
              7 This affects my team
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: