Fixed wrong filling of TextControl, when value is double.

This commit is contained in:
YuSanka 2018-02-12 15:29:21 +01:00
parent badeb2f64c
commit 77bac4c17a
2 changed files with 11 additions and 13 deletions

View file

@ -287,11 +287,10 @@ boost::any ConfigOptionsGroup::config_value(std::string opt_key, int opt_index,
wxString double_to_string(double const value)
{
int precision = 10 * value - int(10 * value) == 0 ? 1 : 2;
return value - int(value) == 0 ?
wxString::Format(_T("%i"), int(value)) :
10 * value - int(10 * value) == 0 ?
wxNumberFormatter::ToString(value, 1) :
wxNumberFormatter::ToString(value, 2);
wxNumberFormatter::ToString(value, precision, wxNumberFormatter::Style_None);
}
boost::any ConfigOptionsGroup::get_config_value(DynamicPrintConfig& config, std::string opt_key, int opt_index/* = -1*/)