Package jmri.util
Class IntlUtilities
java.lang.Object
jmri.util.IntlUtilities
Common utility methods for Internationalization (I18N) and Localization
(L12N) in the default
Locale.
See http://jmri.org/help/en/html/doc/Technical/I8N.shtml- Since:
- 3.9.3
-
Method Summary
Modifier and TypeMethodDescriptionstatic doubledoubleValue(String val) Parse a number.static floatfloatValue(String val) Parse a number.static intParse a number.static StringvalueOf(double val) Get the text representation of a number.static StringvalueOf(int val) Get the text representation of a number.
-
Method Details
-
floatValue
Parse a number. Use as a locale-aware replacement for Float.valueOf("1").floatValue() and Float.parseFloat("1").floatValue().White space, potentially included as a thousand separator is removed.
- Parameters:
val- the value to parse- Returns:
- a parsed number
- Throws:
ParseException- if val cannot be parsed as a number
-
doubleValue
Parse a number. Use as a locale-aware replacement for Double.valueOf("1").doubleValue() and Double.parseDouble("1").doubleValue().White space, potentially included as a thousand separator is removed.
- Parameters:
val- the value to parse- Returns:
- a parsed number
- Throws:
ParseException- if val cannot be parsed as a number
-
intValue
Parse a number. Use as a locale-aware replacement for Integer.valueOf("1").intValue() and Integer.parseInt("1").intValue().White space, potentially included as a thousand separator is removed.
- Parameters:
val- the value to parse- Returns:
- a parsed number
- Throws:
ParseException- if val cannot be parsed as a number
-
valueOf
Get the text representation of a number. Use as a locale-aware replacement for String.valueOf(2.3).- Parameters:
val- the number- Returns:
- the text representation
-
valueOf
Get the text representation of a number. Use as a locale-aware replacement for String.valueOf(5).- Parameters:
val- the number- Returns:
- the text representation
-