简体   繁体   中英

Android displaying different measurements (imperial and metric)

I have an app where I need the user to specify measurements for height width and length. I would like them to be able to input any measurement that they want eg mm, cm, meters, inches, feet, fractions of inches. Does anyone know if Java has a built in mechanism for displaying feet inches etc as

5' 10 3/4"

for example?

I'm not worried about converting the measurements just displaying the imperial measurements.

Thanks, M

You might be able to use the JScience library but that might be overkill unless you proguard everything you dont need away.

But you might also be able to lift the necessary code from it since it is BSD licensed or look at it for inspiration.

In any case you will need to just do some text formatting..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM