mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-21 14:16:31 +01:00
[Summary] This part of code worker incorrectly on Windows:
atof() on Windows expects "," (comma) as float delimeter and ignores "." (dot). So on windows atof("0.1") would return 0.
Unlike MAC.
Proposed fix should work on all platforms.
This commit is contained in:
parent
85bcda2a6e
commit
31a9cefa57
1 changed files with 9 additions and 1 deletions
|
|
@ -49,7 +49,15 @@ xml_property (const XMLNode &node, const char *prop_name, const XMLNodeMap& styl
|
|||
if (property.empty()) {
|
||||
return default_value;
|
||||
}
|
||||
return atof(property.c_str());
|
||||
|
||||
// get float value from string
|
||||
double value;
|
||||
std::istringstream ss (property);
|
||||
// set classic locale with "." float delimeter as default
|
||||
ss.imbue(std::locale("C"));
|
||||
ss >> value;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
double
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue