Skip to main content

Module float_text

Module float_text 

Source
Expand description

PostgreSQL text and JSON forms of a float, including the non-finite values JSON numbers cannot hold.

PostgreSQL renders a non-finite float as NaN, Infinity or -Infinity, and to_json renders it as that text in a JSON string. A JSON number cannot hold these values, and serde_json turns them into null. Every path that renders a float to text or JSON calls these functions instead.

Functionsยง

float_to_json
A float as a JSON value. A finite float is a JSON number. A non-finite float is its PostgreSQL text in a JSON string, as to_json renders it.
non_finite_float_text
The PostgreSQL text of a non-finite float: NaN, Infinity or -Infinity. None for a finite float.