apoc.number.exact.toFloat

Details

Syntax

apoc.number.exact.toFloat(string [, precision, roundingMode ])

Description

Returns the FLOAT of the given large number (using Java BigDecimal).

Arguments

Name

Type

Description

string

STRING

A large number represented as a string.

precision

INTEGER

The rounding precision. The default is: 0.

roundingMode

STRING

A precision rounding mode (UP, DOWN, CEILING, FLOOR, HALF_UP, HALF_DOWN, HALF_EVEN). The default is: HALF_UP.

Returns

FLOAT

Usage Examples

RETURN apoc.number.exact.toFloat('50423.1656', 10) as output;
Results
output

50423.1656

RETURN apoc.number.exact.toFloat('50423.1656', 3) as output;
Results
output

50400.0

RETURN apoc.number.exact.toFloat('50423.1656', 5, "CEILING") as output;
Results
output

50424.0

RETURN apoc.number.exact.toFloat('50423.1656', 5, "FLOOR") as output;
Results
output

50423.0