[JSCIENCE-168] AmountFormat does not return correct value when using getExactDigitsInstance Created: 05/Jun/13  Updated: 05/Jun/13

Status: Open
Project: jscience
Component/s: Mathematics
Affects Version/s: current
Fix Version/s: None

Type: Bug Priority: Major
Reporter: jazeee Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The following works:
System.out.println(Amount.valueOf(0.001, (NonSI.LITER)).to(SI.MILLI(NonSI.LITER)));

Returns (0.9999999999999998 ± 1.7E-16) mL (Or effectively, 1mL)

The following doesn't work correctly:

AmountFormat.setInstance(AmountFormat.getExactDigitsInstance());
System.out.println(Amount.valueOf(0.001, (NonSI.LITER)).to(SI.MILLI(NonSI.LITER)));
Returns 0.100000000000000 mL

This may be related to JSCIENCE-138


Generated at Mon Sep 26 10:10:39 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.