From 0146e8d863e480eb786dc47c105746a3b5480338 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Wed, 7 Sep 2022 15:36:03 +0200 Subject: [PATCH] Follow-up https://github.com/Prusa-Development/PrusaSlicerPrivate/commit/f277bc80c22e0c9a067481a4301922e2c96aed47 - fix for value precision, when value is too small --- src/slic3r/GUI/Field.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index 1a4eb5cc87..e674b52d02 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -33,7 +33,7 @@ wxString double_to_string(double const value, const int max_precision /*= 4*/) // Style_NoTrailingZeroes does not work on OSX. It also does not work correctly with some locales on Windows. // return wxNumberFormatter::ToString(value, max_precision, wxNumberFormatter::Style_NoTrailingZeroes); - wxString s = wxNumberFormatter::ToString(value, max_precision, wxNumberFormatter::Style_None); + wxString s = wxNumberFormatter::ToString(value, value < 0.0001 ? 10 : max_precision, wxNumberFormatter::Style_None); // The following code comes from wxNumberFormatter::RemoveTrailingZeroes(wxString& s) // with the exception that here one sets the decimal separator explicitely to dot.