mysql - is there any library in java for unit conversion? -


i want use unit conversions kg grams, lit ml, etc.. there java library , my-sql tables, available ?

i asked use jscience have populate units in jscience jcombo box or list box.. tel me hod do please ?

you can use jscience...

here's example convert kilogram gram:-

    double gram = measure.valueof(5, si.kilogram).doublevalue(si.gram);     system.out.println(gram); 

here available units:-

    (unit<?> unit : si.units()) {         system.out.println(unit);     } 

the print outs:

m/s? f lm c n h j lx k m/s wb m? gy t w kg v Ω s kat pa sr m m? mol bit °c hz s bq sv rad cd 

by way, i'm using jre 1.4 compatible binary jscience, , need jsr 275 (i pulled maven):

    <dependency>         <groupid>javax.measure</groupid>         <artifactid>jsr-275</artifactid>         <version>1.0.0</version>     </dependency> 

here're import statements, if cares:-

import javax.measure.units.si; import javax.measure.units.unit; import org.jscience.physics.measures.measure; 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -