| java.lang.Object org.springframework.util.NumberUtils
NumberUtils | abstract public class NumberUtils (Code) | | Miscellaneous utility methods for number conversion and parsing.
Mainly for internal use within the framework; consider Jakarta's
Commons Lang for a more comprehensive suite of string utilities.
author: Juergen Hoeller author: Rob Harrop since: 1.1.2 |
Method Summary | |
public static Number | convertNumberToTargetClass(Number number, Class targetClass) Convert the given number into an instance of the given target class.
Parameters: number - the number to convert Parameters: targetClass - the target class to convert to the converted number throws: IllegalArgumentException - if the target class is not supported(i.e. | public static Number | parseNumber(String text, Class targetClass) Parse the given text into a number instance of the given target class,
using the corresponding default decode methods. | public static Number | parseNumber(String text, Class targetClass, NumberFormat numberFormat) Parse the given text into a number instance of the given target class,
using the given NumberFormat. |
|
|