Bug 432972 - Using [oz_av] in conversion never seems to be correct
Summary: Using [oz_av] in conversion never seems to be correct
Status: ASSIGNED
Alias: None
Product: UOMo
Classification: Technology
Component: UCUM (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Werner Keil CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-16 22:50 EDT by Ron Alleva CLA
Modified: 2015-03-03 07:54 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Alleva CLA 2014-04-16 22:50:07 EDT
Like 432200, it seems like sometimes the multiple and divide are reversed.  You can see that in the first two examples, where 16lbs reports as 1 oz.  But in the case of converting to Grams, it seems completely off.

Here is a snippet of the code I ran (0.6.0):

UcumService service = new UcumEssenceService(Play.application().resourceAsStream("ucum-essence.xml"));
System.out.println("16 OZ to LBs    = " + service.convert(new BigDecimal(16), "[oz_av]", "[lb_av]"));
System.out.println("16 LBs to OZ    = " + service.convert(new BigDecimal(16), "[lb_av]", "[oz_av]"));
System.out.println("1 LBs to Grams  = " + service.convert(new BigDecimal(1),  "[lb_av]", "g"));
System.out.println("16 Oz to Grams  = " + service.convert(new BigDecimal(16), "[oz_av]", "g"));
System.out.println("1 Oz to Grams   = " + service.convert(new BigDecimal(1),  "[oz_av]", "g"));

The output of the above is as follows:
16 OZ to LBs    = 256
16 LBs to OZ    = 1
1 LBs to Grams  = 453.59237000
16 Oz to Grams  = 116119.64672000
1 Oz to Grams   = 7257.47792000