commit | 7e91476b89991719ba7a75f16bd8dbba21c7edc9 | [log] [tgz] |
---|---|---|
author | rchandia@google.com <rchandia@google.com@8db76d5a-ed1c-0410-87a9-c151d255dfc7> | Fri Dec 03 11:56:03 2010 +0000 |
committer | rchandia@google.com <rchandia@google.com@8db76d5a-ed1c-0410-87a9-c151d255dfc7> | Fri Dec 03 11:56:03 2010 +0000 |
tree | 659cc7a841c00318dec0f9a0266341ca29c002dc | |
parent | 7adf6f1a8f7d2e21bc39c1e592623ac3b2d62f2c [diff] |
Fixes two issues Issue 5460: Scaffold app expenses does not store decimal values Issue 5663: DoubleParser rounds values to integers Thanks to t.broyer@gmail.com Review at http://gwt-code-reviews.appspot.com/1181802 git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@9353 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/text/client/DoubleParser.java b/user/src/com/google/gwt/text/client/DoubleParser.java index c3977dd..dca4195 100644 --- a/user/src/com/google/gwt/text/client/DoubleParser.java +++ b/user/src/com/google/gwt/text/client/DoubleParser.java
@@ -46,7 +46,7 @@ } try { - return Math.rint(NumberFormat.getDecimalFormat().parse(object.toString())); + return NumberFormat.getDecimalFormat().parse(object.toString()); } catch (NumberFormatException e) { throw new ParseException(e.getMessage(), 0); }
diff --git a/user/test/com/google/gwt/text/client/DoubleParserTest.java b/user/test/com/google/gwt/text/client/DoubleParserTest.java index d14414d..a2f8391 100644 --- a/user/test/com/google/gwt/text/client/DoubleParserTest.java +++ b/user/test/com/google/gwt/text/client/DoubleParserTest.java
@@ -30,7 +30,7 @@ } public void testOuroborus() throws ParseException { - assertEquals("123", DoubleRenderer.instance().render(DoubleParser.instance().parse("123"))); + assertEquals("123.5", DoubleRenderer.instance().render(DoubleParser.instance().parse("123.5"))); } public void testNull() throws ParseException {