Fixed third batch of locale-dependent calls

This commit is contained in:
Lukas Matena 2021-05-10 08:13:23 +02:00
parent fef385cd6b
commit c5c6f51ae0
11 changed files with 34 additions and 26 deletions

View file

@ -1,6 +1,8 @@
#include "Config.hpp"
#include "format.hpp"
#include "Utils.hpp"
#include "LocalesUtils.hpp"
#include <assert.h>
#include <fstream>
#include <iostream>
@ -462,7 +464,7 @@ void ConfigBase::set(const std::string &opt_key, double value, bool create)
switch (opt->type()) {
case coFloat: static_cast<ConfigOptionFloat*>(opt)->value = value; break;
case coFloatOrPercent: static_cast<ConfigOptionFloatOrPercent*>(opt)->value = value; static_cast<ConfigOptionFloatOrPercent*>(opt)->percent = false; break;
case coString: static_cast<ConfigOptionString*>(opt)->value = std::to_string(value); break;
case coString: static_cast<ConfigOptionString*>(opt)->value = float_to_string_decimal_point(value); break;
default: throw BadOptionTypeException("Configbase::set() - conversion from float not possible");
}
}