mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-24 22:26:52 -05:00
fix serialisation of floating point numbers in SuperEasyJSON for german locale. JSON expects decimal points, but german locale used comma.
This commit is contained in:
parent
7a144c231b
commit
ab25e35861
@ -521,6 +521,15 @@ std::string SerializeValue(const Value& v)
|
||||
case StringVal : str = "\"" + EscapeJSONString((std::string)v) + "\""; break;
|
||||
}
|
||||
|
||||
// snprintf creates commas on german computers
|
||||
// json expets decimal points, so replace all commas with decimal points
|
||||
if(v.GetType() == FloatVal || v.GetType() == DoubleVal)
|
||||
{
|
||||
for(int i = 0; i < str.size(); i++)
|
||||
if(str[i] == ',')
|
||||
str[i] = '.';
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user