The NumberFormat and DecimalFormat classes provide support for parsing and formatting values.
They are also locale sensitive, which means they adjust the formatting and parsing rules according to the locale or region of interest.
For example in France they use a comma as a decimal separator so 5,48 is the same as 5.48 in the USA.
NumberFormat format = NumberFormat.getInstance(Locale.FRANCE); Object value = format.parse("5,48");
Leave a Reply
You must be logged in to post a comment.