Class FlowableExpressionFormatUtils
java.lang.Object
com.flowable.platform.expressions.FlowableExpressionFormatUtils
Expression Bean Name: flw.format
Offers a number of formatting utils, mostly related to numbers, currencies and strings.
All methods which accept a language tag must be supplied with a string consisting of the language code and the country,
e.g. "ch-DE", "en-US" etc.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionformatCurrencyWithLocale
(String currencyCode, double amount, String languageTag) Formats a currency amount according to the format specified in the locale of the provided language tag.formatDate
(Object value, String dateFormat) Formats the input to a String with the given format.formatDecimal
(String pattern, double decimal) Formats a String according to the Java Formatter specification with a Decimal Formatter in the default locale.formatString
(String text, Object... substitutes) Formats a String according to the Java Formatter specification, see https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html or https://docs.oracle.com/javase/tutorial/java/data/numberformat.htmlformatStringWithLocale
(String languageTag, String text, Object... substitutes) Formats a String according to the Java Formatter specification, see https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html or https://docs.oracle.com/javase/tutorial/java/data/numberformat.html.
-
Constructor Details
-
FlowableExpressionFormatUtils
public FlowableExpressionFormatUtils()
-
-
Method Details
-
formatString
Formats a String according to the Java Formatter specification, see https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html or https://docs.oracle.com/javase/tutorial/java/data/numberformat.html- Parameters:
text
- String to be formattedsubstitutes
- Objects to be replaced- Returns:
- Text where all placeholders have been replaced
-
formatDate
Formats the input to a String with the given format. Supported inputs are:- Date
- Instant
- LocalDate
- LocalDateTime
- ISO 8601 String
- Parameters:
value
- the input to convert, nevernull
dateFormat
- the date format to be used- Returns:
- the formatted date
-
formatDecimal
Formats a String according to the Java Formatter specification with a Decimal Formatter in the default locale. See https://docs.oracle.com/javase/tutorial/java/data/numberformat.html- Parameters:
pattern
- Decimal Pattern to be useddecimal
- Decimal to be formatted- Returns:
- Text where all placeholders have been replaced
-
formatStringWithLocale
Formats a String according to the Java Formatter specification, see https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html or https://docs.oracle.com/javase/tutorial/java/data/numberformat.html. The string is formatted according to the format specified in the locale of the provided language tag.- Parameters:
languageTag
- The language to be used when formatting, e.g. "de-CH"text
- The text to be formattedsubstitutes
- The substitutes in the order of their appearance.- Returns:
- Text where all placeholders have been replaced
-
formatCurrencyWithLocale
Formats a currency amount according to the format specified in the locale of the provided language tag.- Parameters:
currencyCode
- The currency ot be formatted withlanguageTag
- The language to be used when formatting, e.g. "de-CH".amount
- The amount to be formatted- Returns:
- The formatted currency amount
-