Class NumberFormatter


  • public class NumberFormatter
    extends Object
    Formatter of date values using DecimalFormat.
    • Constructor Detail

      • NumberFormatter

        public NumberFormatter()
    • Method Detail

      • format

        public static String format​(BigDecimal number,
                                    String formatString)
        Formats number with format based on DecimalFormat with default ICU locale and additional settings in selected V8 format string.
        Parameters:
        number - the number
        locale - the locale
        Returns:
        formatted number
      • format

        public static String format​(BigDecimal number,
                                    com.ibm.icu.util.ULocale locale)
        Formats number with pure DecimalFormat with selected ICU locale.
        Parameters:
        number - the number
        locale - the locale
        Returns:
        formatted number
      • getFormat

        public static com.ibm.icu.text.DecimalFormat getFormat​(com.ibm.icu.util.ULocale locale)