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

decimal strings make toInteger() throw exception

    XMLWordPrintableJSON

Details

    • Test
    • Status: Closed
    • Minor
    • Resolution: Not A Problem
    • 1.8.0, 2.0.0
    • None
    • Compiler, groovy-jdk
    • Windows. GRECLIPSE, and the 1.8 Groovy Console

    Description

      println '428.0'.toInteger() throws NumberFormatException.
      println '428.0'.toDouble().toInteger() prints 428 as expected.

      Is this a bug or feature?

      Attachments

        Activity

          People

            Unassigned Unassigned
            b174393xxx Jon Williams
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: