You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function atof used in URI.cpp returns integer values for floating point numbers if an application uses locale where comma is used to separate the integer part.
Example:
URI uri("osx:?setting=1.5");
double setting = 0.;
URI::getQueryArg(uri.query, "setting", &setting);
// here setting maybe equal to 1 instead of 1.5
This can be corrected with
setlocale(LC_NUMERIC, "C")
before using the function, however we need to put the current locale back afterwards.
The easier option could be using istringstream to read the numbers, since it uses US locale by default.
The text was updated successfully, but these errors were encountered:
The function
atof
used in URI.cpp returns integer values for floating point numbers if an application uses locale where comma is used to separate the integer part.Example:
This can be corrected with
before using the function, however we need to put the current locale back afterwards.
The easier option could be using
istringstream
to read the numbers, since it usesUS locale
by default.The text was updated successfully, but these errors were encountered: