diff --git a/src/propgrid/advprops.cpp b/src/propgrid/advprops.cpp index 25154526d2..8d95388738 100644 --- a/src/propgrid/advprops.cpp +++ b/src/propgrid/advprops.cpp @@ -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 { diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index 1e08d7da5b..d04dcc86b9 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -465,24 +465,19 @@ bool NumericValidation( const wxPGProperty* property, if ( minOk || maxOk ) { - // Get required precision. - int precision = -1; - variant = property->GetAttribute(wxPG_FLOAT_PRECISION); - if ( !variant.IsNull() ) - { - precision = variant.GetInteger(); - } - // Round current value to the required precision. - wxString strVal = wxNumberFormatter::ToString(value, precision, wxNumberFormatter::Style_None); + variant = value; + wxString strVal = property->ValueToString(variant, wxPG_FULL_VALUE); strVal.ToDouble(&value); // Round minimal value to the required precision. - strVal = wxNumberFormatter::ToString(min, precision, wxNumberFormatter::Style_None); + variant = min; + strVal = property->ValueToString(variant, wxPG_FULL_VALUE); strVal.ToDouble(&min); // Round maximal value to the required precision. - strVal = wxNumberFormatter::ToString(max, precision, wxNumberFormatter::Style_None); + variant = max; + strVal = property->ValueToString(variant, wxPG_FULL_VALUE); strVal.ToDouble(&max); }