apoc.number.exact.toFloat

Function APOC Core

apoc.number.exact.toFloat(string,[prec],[roundingMode]) - return the Float value of a large number

Signature

apoc.number.exact.toFloat(stringA :: STRING?, precision = 0 :: INTEGER?, roundingMode = HALF_UP :: STRING?) :: (FLOAT?)

Input parameters

Name Type Default

stringA

STRING?

null

precision

INTEGER?

0

roundingMode

STRING?

HALF_UP

Usage Examples

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

50423.1656

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

50400.0

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

50424.0

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

50423.0