Number Format Conversions
Functions for number format conversions
| Qualified Name | Type |
|---|---|
|
Function |
|
Function |
|
Function |
-
For the full list of supported values for the
patternandlanguageparameters, see Java’s DecimalFormat page.
Examples
The following formats a double value using the default system pattern:
RETURN apoc.number.format(12345.67) as value;
| Value |
|---|
12,345.67 |
The following formats a double value, using
. as thousand separator, , as decimal separator, rounding down:RETURN apoc.number.format(12345, '#,##0.00;(#,##0.00)', 'it') as value;
| Value |
|---|
12.345,00 |
The following formats a double value, using
. as thousand separator and , as decimal separator:RETURN apoc.number.format(12345.67, '#,##0.00;(#,##0.00)', 'it') as value;
| Value |
|---|
12.345,67 |
The following parses a formatted value as an int:
RETURN apoc.number.parseInt('12.345', '#,##0.00;(#,##0.00)', 'it') as value;
| Value |
|---|
12345 |
The following parses a formatted value as a float:
RETURN apoc.number.parseFloat('12.345,67', '#,##0.00;(#,##0.00)', 'it') as value;
| Value |
|---|
12345.67 |
The following formats a non numeric value:
RETURN apoc.number.format('aaa') AS value;
| Value |
|---|
null |
The following parses a non numeric value:
RETURN apoc.number.parseInt('aaa') AS value;
| Value |
|---|
null |