Use dedicated function to get rounded value of wxFloatProperty

wxFloatProperty::ValueToString() returns string representing value rounded with required precision so we don't need to retrieve wxPG_FLOAT_PRECISION attribute and do rounding on our own.
This commit is contained in:
Artur Wieczorek
2019-04-20 22:38:58 +02:00
parent 2898e8136a
commit 76584e2d3c
2 changed files with 8 additions and 19 deletions

View File

@@ -381,14 +381,8 @@ bool wxPGSpinCtrlEditor::OnEvent( wxPropertyGrid* propgrid, wxPGProperty* proper
// Min/Max check
wxFloatProperty::DoValidation(property, v_d, NULL, mode);
int precision = -1;
wxVariant v = property->GetAttribute(wxPG_FLOAT_PRECISION);
if ( !v.IsNull() )
{
precision = v.GetInteger();
}
s = wxNumberFormatter::ToString(v_d, precision, wxNumberFormatter::Style_NoTrailingZeroes);
wxVariant v(v_d);
s = property->ValueToString(v, 0);
}
else
{