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:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user