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

Adding milliseconds with TimeCategory gives incorrect toString

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.5
    • 2.0.6, 2.1.0-beta-1, 1.8.9
    • groovy-jdk
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: