public final class NumberUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
format(Number target,
Integer minIntegerDigits,
Integer decimalDigits,
Locale locale) |
static String |
format(Number target,
Integer minIntegerDigits,
Integer decimalDigits,
NumberPointType decimalPointType,
Locale locale) |
static String |
format(Number target,
Integer minIntegerDigits,
Locale locale) |
static String |
format(Number target,
Integer minIntegerDigits,
NumberPointType thousandsPointType,
Integer decimalDigits,
Locale locale) |
static String |
format(Number target,
Integer minIntegerDigits,
NumberPointType thousandsPointType,
Integer decimalDigits,
NumberPointType decimalPointType,
Locale locale) |
static String |
format(Number target,
Integer minIntegerDigits,
NumberPointType thousandsPointType,
Locale locale) |
static String |
formatCurrency(Number target,
Locale locale)
Formats a number as a currency value according to the specified locale.
|
static String |
formatPercent(Number target,
Integer minIntegerDigits,
Integer fractionDigits,
Locale locale)
Formats a number as a percentage value.
|
static Integer[] |
sequence(Integer from,
Integer to)
Produces an array with a sequence of integer numbers.
|
static Integer[] |
sequence(Integer from,
Integer to,
Integer step)
Produces an array with a sequence of integer numbers, using a step.
|
public static String format(Number target, Integer minIntegerDigits, NumberPointType thousandsPointType, Locale locale)
public static String format(Number target, Integer minIntegerDigits, Integer decimalDigits, Locale locale)
public static String format(Number target, Integer minIntegerDigits, Integer decimalDigits, NumberPointType decimalPointType, Locale locale)
public static String format(Number target, Integer minIntegerDigits, NumberPointType thousandsPointType, Integer decimalDigits, Locale locale)
public static String format(Number target, Integer minIntegerDigits, NumberPointType thousandsPointType, Integer decimalDigits, NumberPointType decimalPointType, Locale locale)
public static Integer[] sequence(Integer from, Integer to)
Produces an array with a sequence of integer numbers.
from
- value to start the sequence fromto
- value to produce the sequence topublic static Integer[] sequence(Integer from, Integer to, Integer step)
Produces an array with a sequence of integer numbers, using a step.
from
- value to start the sequence fromto
- value to produce the sequence tostep
- the step to be usedpublic static String formatCurrency(Number target, Locale locale)
target
- The number to format.locale
- Locale to use for formatting.null
if the number
given is null
.public static String formatPercent(Number target, Integer minIntegerDigits, Integer fractionDigits, Locale locale)
target
- The number to format.minIntegerDigits
- Minimum number of digits to return (0 padding).fractionDigits
- Minimum number of fraction digits to return (0
padding).locale
- Locale to use for formatting.null
if the
number given is null
.Copyright © 2017 The THYMELEAF team. All rights reserved.