ostium.proto.format_num

ostium.proto

format_num(n) -> formatted, err

Format a number for the wire

%.14g matches LuaJIT's own tostring precision: enough significant digits to carry unix timestamps intact (a plain %.9g would round them), while never printing locale-dependent or exponentless noise. Non-finite values are rejected.