mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-07 12:54:00 +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 "fallback.hpp"
|
||||||
|
|
||||||
|
#include <boost/lexical_cast.hpp>
|
||||||
|
|
||||||
|
|
||||||
namespace Fallback
|
namespace Fallback
|
||||||
{
|
{
|
||||||
bool stob(std::string const& s) {
|
bool stob(std::string const& s) {
|
||||||
@ -23,8 +26,9 @@ namespace Fallback
|
|||||||
std::string fallback=getFallbackString(fall);
|
std::string fallback=getFallbackString(fall);
|
||||||
if(fallback.empty())
|
if(fallback.empty())
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else {
|
||||||
return std::stof(fallback);
|
return boost::lexical_cast<float>(fallback);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
int Map::getFallbackInt(const std::string& fall) const
|
int Map::getFallbackInt(const std::string& fall) const
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user