Changeset 3238


Ignore:
Timestamp:
Apr 12, 2007, 12:04:45 AM (16 years ago)
Author:
Nicklas Nordborg
Message:

:Fixes #562:Support for scientific notation for number when parsing data files

Location:
branches/2.2.3/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.3/src/core/net/sf/basedb/core/Type.java

    r3023 r3238  
    418418      if (pos.getIndex() < value.length())
    419419      {
    420         throw new NumberFormatException("For input string: \"" + value + "\"");
     420        if (value.indexOf('e') >= 0)
     421        {
     422          // Convert 'e' to 'E' (in scientific notation only 'E' is allowed) and try again
     423          return parseString(value.replace('e', 'E'), numberFormat);
     424        }
     425        else
     426        {
     427          throw new NumberFormatException("For input string: \"" + value + "\"");
     428        }
    421429      }
    422430      return convertNumber(num);
  • branches/2.2.3/src/test/TestAll.java

    r3062 r3238  
    122122    results.put("TestDbInfo", TestDbInfo.test_all());
    123123    results.put("TestPresets", TestPresets.test_all());
     124    results.put("TestNumberFormat", TestNumberFormat.test_all());
    124125
    125126    // Plugins, jobs
Note: See TracChangeset for help on using the changeset viewer.