MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxStringifyJSONNumber

Function fxStringifyJSONNumber

xs/sources/xsJSON.c:942–952  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

940}
941
942void fxStringifyJSONNumber(txMachine* the, txJSONStringifier* theStringifier, txNumber theNumber)
943{
944 int fpclass = c_fpclassify(theNumber);
945 if ((fpclass != C_FP_NAN) && (fpclass != C_FP_INFINITE)) {
946 char aBuffer[256];
947 fxNumberToString(the, theNumber, aBuffer, sizeof(aBuffer), 0, 0);
948 fxStringifyJSONChars(the, theStringifier, aBuffer, (txSize)c_strlen(aBuffer));
949 }
950 else
951 fxStringifyJSONChars(the, theStringifier, "null", 4);
952}
953
954void fxStringifyJSONProperty(txMachine* the, txJSONStringifier* theStringifier, txInteger* theFlag)
955{

Callers 1

fxStringifyJSONPropertyFunction · 0.85

Calls 3

c_fpclassifyFunction · 0.85
fxNumberToStringFunction · 0.85
fxStringifyJSONCharsFunction · 0.85

Tested by

no test coverage detected