1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-09 14:21:03 +03:00

Fix json rendering so that it shows positive and negative infinity as

9.0e+999 and -9.0e+999 respectively.

FossilOrigin-Name: efce4690a52592c4f5fc7d023eebe771b0e615bb03c0fe203493f853b28e8f85
This commit is contained in:
drh
2023-03-17 20:31:24 +00:00
parent f204be8098
commit 667b5cc985
5 changed files with 38 additions and 16 deletions

View File

@@ -307,8 +307,11 @@ static void jsonAppendValue(
jsonAppendRaw(p, "null", 4);
break;
}
case SQLITE_INTEGER:
case SQLITE_FLOAT: {
jsonPrintf(100, p, "%!0.15g", sqlite3_value_double(pValue));
break;
}
case SQLITE_INTEGER: {
const char *z = (const char*)sqlite3_value_text(pValue);
u32 n = (u32)sqlite3_value_bytes(pValue);
jsonAppendRaw(p, z, n);