mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 17:27:52 -06:00
Merge remote-tracking branch 'origin/master' into new_main_page_ui
This commit is contained in:
commit
0371f368a4
87 changed files with 12046 additions and 4249 deletions
|
@ -12,10 +12,20 @@ namespace Slic3r { namespace GUI {
|
|||
|
||||
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)) :
|
||||
wxNumberFormatter::ToString(value, precision, wxNumberFormatter::Style_None);
|
||||
if (value - int(value) == 0)
|
||||
return wxString::Format(_T("%i"), int(value));
|
||||
else {
|
||||
int precision = 4;
|
||||
for (size_t p = 1; p < 4; p++)
|
||||
{
|
||||
double cur_val = pow(10, p)*value;
|
||||
if (cur_val - int(cur_val) == 0) {
|
||||
precision = p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return wxNumberFormatter::ToString(value, precision, wxNumberFormatter::Style_None);
|
||||
}
|
||||
}
|
||||
|
||||
void Field::PostInitialize(){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue