Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-5751

Adding milliseconds with TimeCategory gives incorrect toString

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.5
    • Fix Version/s: 2.0.6, 2.1.0-beta-1, 1.8.9
    • Component/s: groovy-jdk
    • Labels:
      None

      Description

      From this question on StackOverflow, doing:

      def a = use(groovy.time.TimeCategory) {
        800.millisecond + 300.millisecond
      }
      println a
      

      Gives the output:

      0.1100 seconds
      

      When it should show either:

      1100 milliseconds
      

      or

      1.1 seconds
      

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              tim_yates Tim Yates
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: