Added code to remove sign from zero in wxPropertyGrid::DoubleToString(). Fixes #12738.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66363 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -713,6 +713,25 @@ void wxPropertyGrid::DoubleToString(wxString& target,
|
|||||||
if ( new_len != target.length() )
|
if ( new_len != target.length() )
|
||||||
target.resize(new_len);
|
target.resize(new_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove sign from zero
|
||||||
|
if ( target.length() >= 2 && target[0] == wxS('-') )
|
||||||
|
{
|
||||||
|
bool isZero = true;
|
||||||
|
wxString::const_iterator i = target.begin() + 1;
|
||||||
|
|
||||||
|
for ( ; i != target.end(); i++ )
|
||||||
|
{
|
||||||
|
if ( *i != wxS('0') && *i != wxS('.') )
|
||||||
|
{
|
||||||
|
isZero = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( isZero )
|
||||||
|
target.erase(target.begin());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxFloatProperty::ValueToString( wxVariant& value,
|
wxString wxFloatProperty::ValueToString( wxVariant& value,
|
||||||
|
Reference in New Issue
Block a user