Formatting and converting data in Java

This entry is part of the Maximo Java Development series.

If you need to format dates and numbers into a locale-sensitive string or if you just need to convert data between different types then take a look at psdi.util.MaxType class.
For example, the following piece of code shows how to correctly format a currency amount into a string.
MaxType mt = new MaxType(MaxType.AMOUNT);
mt.setValue(10.1234);
String s = mt.asLocaleString();

Labels: ,