Search code examples
javaenumsisomeasure

How to convert ISO code to localized measure unit in java?


I'm currently trying to convert ISOCODE measure units into the fulltext labels.

For example I'll receive a string such as "LTR" and try to convert it to "Liter". It's in german so I'm also looking for a possibility to do this localized.

Is there a library or so which is already doing this? Is there an enum somewhere, containing all these information?

Otherwise, I guess I'll just have to create one myself.

Thanks a lot.


Solution

  • JSR 363 deals with units of measurement and has been implemented in UOM . You can browse the javadoc to get an idea of what's in there.

    There was a project called the JScience project, but it doesn't seem to have been updated for some time.