Number To String (Locale)

Converts selected number columns to string columns formatted according to a specified locale (e.g. country). The locale provides conventions such as the characters used to separate thousands groups, the currency symbol, and the character used to specify the decimal.

In addition to the conventions provided by the locale, a 'format pattern' is specified and allows for fine control of the format (for example, the number of decimal places to show, whether to use scientific notation, whether to display a currency symbol, etc.) You can select one of the predefined format patterns or specify a custom pattern. The specification of the pattern is defined by the DecimalFormat Java class.

From http://tutorials.jenkov.com/java-internationalization/decimalformat.html#number-format-pattern-syntax
You can use the following characters in a custom formatting pattern:

0%%00009A digit - always displayed, even if number has less digits (then 0 is displayed)
#%%00009A digit, leading zeroes are omitted.
.%%00009Marks decimal separator
,%%00009Marks grouping separator (e.g. thousand separator)
E%%00009Separates mantissa and exponent for exponential formats.
;%%00009Separates positive and negative subpatterns
-%%00009Marks the negative number prefix
%%%00009Multiplies by 100 and shows number as percentage
‰%%00009Multiplies by 1000 and shows number as per mille
¤%%00009Currency sign - replaced by the currency sign for the Locale. Also makes formatting use the monetary decimal separator instead of normal decimal separator. ¤¤ makes formatting use international monetary symbols.
X%%00009Marks a character to be used in number prefix or suffix
'%%00009Marks a quote around special characters in prefix or suffix of formatted number.

Official Java documentation: https://docs.oracle.com/javase/8/docs/api/java/text/DecimalFormat.html
Locales are accurate as of Java 1.8.0_252
Disclaimer: This component is believed to operate correctly, but the developer offers no warranty and bears no responsibility for consequences resulting from its use.

Options

Select columns to format
Only numeric columns are selectable.
Select a locale
Numbers will be formatted according to the conventions of the specified locale.%%00010Selecting 'default' will use the locale associated with the Java Virtual Machine running the workflow.
Predefined formats
Select 'default' for the default format of the selected locale (typically formatted to 2 decimal places). Otherwise, select a specific predefined format. If a custom format is specified (see below), it will override this format.
Rounding mode to use (HALF_EVEN is the default)
CEILING%%00010Rounding mode to round towards positive infinity.%%00010DOWN%%00010Rounding mode to round towards zero.%%00010FLOOR%%00010Rounding mode to round towards negative infinity.%%00010HALF_DOWN%%00010Rounding mode to round towards "nearest neighbor" unless both neighbors are equidistant, in which case round down.%%00010HALF_EVEN (this is the default)%%00010Rounding mode to round towards the "nearest neighbor" unless both neighbors are equidistant, in which case, round towards the even neighbor.%%00010HALF_UP%%00010Rounding mode to round towards "nearest neighbor" unless both neighbors are equidistant, in which case round up.%%00010UNNECESSARY%%00010Rounding mode to assert that the requested operation has an exact result, hence no rounding is necessary. Caution: if application of format would result in truncation of the number, a missing value is output.%%00010UP%%00010Rounding mode to round away from zero.
Custom decimal format pattern (leave empty to use predefined format)
For more info, see http://tutorials.jenkov.com/java-internationalization/decimalformat.html#number-format-pattern-syntax%%00010or https://docs.oracle.com/javase/8/docs/api/java/text/DecimalFormat.html

Input Ports

Icon
Table containing one or more numeric columns to convert to formatted string columns

Output Ports

Icon
Table containing formatted string columns

Nodes

Extensions

Links