Package org.thymeleaf.expression
Class Numbers
- Object
-
- org.thymeleaf.expression.Numbers
-
public final class Numbers extends Object
Expression Object for performing numeric operations (esp. number formatting) inside Thymeleaf Standard Expressions.
An object of this class is usually available in variable evaluation expressions with the name
#numbers
.- Since:
- 1.0
- Author:
- Daniel Fernández
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]
arrayFormatCurrency(Object[] target)
String[]
arrayFormatDecimal(Object[] target, Integer minIntegerDigits, Integer decimalDigits)
String[]
arrayFormatDecimal(Object[] target, Integer minIntegerDigits, Integer decimalDigits, String decimalPointType)
String[]
arrayFormatDecimal(Object[] target, Integer minIntegerDigits, String thousandsPointType, Integer decimalDigits, String decimalPointType)
String[]
arrayFormatInteger(Object[] target, Integer minIntegerDigits)
String[]
arrayFormatInteger(Object[] target, Integer minIntegerDigits, String thousandsPointType)
String[]
arrayFormatPercent(Object[] target, Integer minIntegerDigits, Integer decimalDigits)
String
formatCurrency(Number target)
String
formatDecimal(Number target, Integer minIntegerDigits, Integer decimalDigits)
String
formatDecimal(Number target, Integer minIntegerDigits, Integer decimalDigits, String decimalPointType)
String
formatDecimal(Number target, Integer minIntegerDigits, String thousandsPointType, Integer decimalDigits, String decimalPointType)
String
formatInteger(Number target, Integer minIntegerDigits)
String
formatInteger(Number target, Integer minIntegerDigits, String thousandsPointType)
String
formatPercent(Number target, Integer minIntegerDigits, Integer decimalDigits)
List<String>
listFormatCurrency(List<? extends Number> target)
List<String>
listFormatDecimal(List<? extends Number> target, Integer minIntegerDigits, Integer decimalDigits)
List<String>
listFormatDecimal(List<? extends Number> target, Integer minIntegerDigits, Integer decimalDigits, String decimalPointType)
List<String>
listFormatDecimal(List<? extends Number> target, Integer minIntegerDigits, String thousandsPointType, Integer decimalDigits, String decimalPointType)
List<String>
listFormatInteger(List<? extends Number> target, Integer minIntegerDigits)
List<String>
listFormatInteger(List<? extends Number> target, Integer minIntegerDigits, String thousandsPointType)
List<String>
listFormatPercent(List<? extends Number> target, Integer minIntegerDigits, Integer decimalDigits)
Integer[]
sequence(Integer from, Integer to)
Produces an array with a sequence of integer numbers.Integer[]
sequence(Integer from, Integer to, Integer step)
Produces an array with a sequence of integer numbers, using the specified step.Set<String>
setFormatCurrency(Set<? extends Number> target)
Set<String>
setFormatDecimal(Set<? extends Number> target, Integer minIntegerDigits, Integer decimalDigits)
Set<String>
setFormatDecimal(Set<? extends Number> target, Integer minIntegerDigits, Integer decimalDigits, String decimalPointType)
Set<String>
setFormatDecimal(Set<? extends Number> target, Integer minIntegerDigits, String thousandsPointType, Integer decimalDigits, String decimalPointType)
Set<String>
setFormatInteger(Set<? extends Number> target, Integer minIntegerDigits)
Set<String>
setFormatInteger(Set<? extends Number> target, Integer minIntegerDigits, String thousandsPointType)
Set<String>
setFormatPercent(Set<? extends Number> target, Integer minIntegerDigits, Integer decimalDigits)
-
-
-
Constructor Detail
-
Numbers
public Numbers(Locale locale)
-
-
Method Detail
-
listFormatInteger
public List<String> listFormatInteger(List<? extends Number> target, Integer minIntegerDigits)
-
setFormatInteger
public Set<String> setFormatInteger(Set<? extends Number> target, Integer minIntegerDigits)
-
formatInteger
public String formatInteger(Number target, Integer minIntegerDigits, String thousandsPointType)
-
arrayFormatInteger
public String[] arrayFormatInteger(Object[] target, Integer minIntegerDigits, String thousandsPointType)
-
listFormatInteger
public List<String> listFormatInteger(List<? extends Number> target, Integer minIntegerDigits, String thousandsPointType)
-
setFormatInteger
public Set<String> setFormatInteger(Set<? extends Number> target, Integer minIntegerDigits, String thousandsPointType)
-
formatDecimal
public String formatDecimal(Number target, Integer minIntegerDigits, Integer decimalDigits)
-
arrayFormatDecimal
public String[] arrayFormatDecimal(Object[] target, Integer minIntegerDigits, Integer decimalDigits)
-
listFormatDecimal
public List<String> listFormatDecimal(List<? extends Number> target, Integer minIntegerDigits, Integer decimalDigits)
-
setFormatDecimal
public Set<String> setFormatDecimal(Set<? extends Number> target, Integer minIntegerDigits, Integer decimalDigits)
-
formatDecimal
public String formatDecimal(Number target, Integer minIntegerDigits, Integer decimalDigits, String decimalPointType)
-
arrayFormatDecimal
public String[] arrayFormatDecimal(Object[] target, Integer minIntegerDigits, Integer decimalDigits, String decimalPointType)
-
listFormatDecimal
public List<String> listFormatDecimal(List<? extends Number> target, Integer minIntegerDigits, Integer decimalDigits, String decimalPointType)
-
setFormatDecimal
public Set<String> setFormatDecimal(Set<? extends Number> target, Integer minIntegerDigits, Integer decimalDigits, String decimalPointType)
-
formatDecimal
public String formatDecimal(Number target, Integer minIntegerDigits, String thousandsPointType, Integer decimalDigits, String decimalPointType)
-
arrayFormatDecimal
public String[] arrayFormatDecimal(Object[] target, Integer minIntegerDigits, String thousandsPointType, Integer decimalDigits, String decimalPointType)
-
listFormatDecimal
public List<String> listFormatDecimal(List<? extends Number> target, Integer minIntegerDigits, String thousandsPointType, Integer decimalDigits, String decimalPointType)
-
setFormatDecimal
public Set<String> setFormatDecimal(Set<? extends Number> target, Integer minIntegerDigits, String thousandsPointType, Integer decimalDigits, String decimalPointType)
-
formatPercent
public String formatPercent(Number target, Integer minIntegerDigits, Integer decimalDigits)
-
arrayFormatPercent
public String[] arrayFormatPercent(Object[] target, Integer minIntegerDigits, Integer decimalDigits)
-
listFormatPercent
public List<String> listFormatPercent(List<? extends Number> target, Integer minIntegerDigits, Integer decimalDigits)
-
setFormatPercent
public Set<String> setFormatPercent(Set<? extends Number> target, Integer minIntegerDigits, Integer decimalDigits)
-
sequence
public Integer[] sequence(Integer from, Integer to)
Produces an array with a sequence of integer numbers.
- Parameters:
from
- value to start the sequence fromto
- value to produce the sequence to- Returns:
- the Integer[] sequence
- Since:
- 1.1.2
-
sequence
public Integer[] sequence(Integer from, Integer to, Integer step)
Produces an array with a sequence of integer numbers, using the specified step.
- Parameters:
from
- value to start the sequence fromto
- value to produce the sequence tostep
- the step to be used- Returns:
- the Integer[] sequence
- Since:
- 2.0.9
-
-