Skip to main content

aggregateNumber()

@gravity-rail/react


@gravity-rail/react / aggregateNumber

Function: aggregateNumber()

aggregateNumber(value): number | null

Convert an aggregate value to a JS number, or null for SQL NULL (an average over no rows). A decimal string such as "47.63" parses to the nearest double, which is exact enough to display and chart; digits beyond a double's precision (about 15 to 17 significant digits) are rounded. The one guard is on the integer part: a value with more than 15 integer digits throws a RangeError, because a double cannot hold every integer that large. Keep the string for such values.

Parameters​

value​

RecordAggregateValue

Returns​

number | null