mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
std::stof can not handle comma in us localization and can not handle period in french localization, using std::replace is not a solution, going back to boost::lexical_cast
This commit is contained in:
parent
f0b21cca22
commit
7c758a6293
@ -1,5 +1,8 @@
|
||||
#include "fallback.hpp"
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
|
||||
namespace Fallback
|
||||
{
|
||||
bool stob(std::string const& s) {
|
||||
@ -23,8 +26,9 @@ namespace Fallback
|
||||
std::string fallback=getFallbackString(fall);
|
||||
if(fallback.empty())
|
||||
return 0;
|
||||
else
|
||||
return std::stof(fallback);
|
||||
else {
|
||||
return boost::lexical_cast<float>(fallback);
|
||||
}
|
||||
}
|
||||
int Map::getFallbackInt(const std::string& fall) const
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user