Brian Zable created MATH-1395:
---------------------------------
Summary: MathParseException when parsing fractions on Android
Key: MATH-1395
URL: https://issues.apache.org/jira/browse/MATH-1395
Project: Commons Math
Issue Type: Bug
Reporter: Brian Zable
I'm seeing a strange issue when trying to work with the Fraction classes on
Android. In my tests, which are standard JUnit tests, the following code
performs flawlessly;
{code:java}
String amount = "1 1/2";
ProperFractionFormat ff = new ProperFractionFormat();
Fraction f = ff.parse(amount.trim());
{code}
However, at run time in an Android application, the same code throws an
Exception:
{noformat}
Caused by:
org.apache.commons.math3.exception.MathParseException: illegal state: string "1
1/2" unparseable (from position 3) as an object of type
org.apache.commons.math3.fraction.Fraction
at
org.apache.commons.math3.fraction.FractionFormat.parse(FractionFormat.java:199)
{noformat}
I am testing on a Nexus 5X emulator with API level 23 for reference.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)