The OpenD Programming Language

serializeValue

Number serialization

Examples

import mir.ser.json: serializeJson;

assert(serializeJson(2.40f) == `2.4`);
assert(serializeJson(float.nan) == `"nan"`);
assert(serializeJson(float.infinity) == `"+inf"`);
assert(serializeJson(-float.infinity) == `"-inf"`);

Meta