mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-15 00:24:19 +00:00
Fix for JSON stringification of INF and NaN double values
This commit is contained in:
parent
77634bc802
commit
d5034083cb
1 changed files with 6 additions and 1 deletions
|
|
@ -348,7 +348,12 @@ struct JSONFormatter
|
|||
}
|
||||
else if (v.isDouble())
|
||||
{
|
||||
out << String (static_cast<double> (v), maximumDecimalPlaces);
|
||||
auto d = static_cast<double> (v);
|
||||
|
||||
if (juce_isfinite (d))
|
||||
out << String (d, maximumDecimalPlaces);
|
||||
else
|
||||
out << "null";
|
||||
}
|
||||
else if (v.isArray())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue