Make zero-stripping sensitive to locale separator.

Fixes https://gitlab.com/kicad/code/kicad/issues/5813
This commit is contained in:
Jeff Young 2020-09-30 23:26:37 +01:00
parent 6abe68fff0
commit 4165ae6df1
1 changed files with 4 additions and 3 deletions

View File

@ -116,8 +116,10 @@ void DIMENSION::addShape( ShapeType* aShape )
wxString DIMENSION::GetValueText() const
{
int val = GetMeasuredValue();
struct lconv* lc = localeconv();
wxChar sep = lc->decimal_point[0];
int val = GetMeasuredValue();
wxString text;
wxString format = wxT( "%." ) + wxString::Format( "%i", m_precision ) + wxT( "f" );
@ -129,13 +131,12 @@ wxString DIMENSION::GetValueText() const
{
text.RemoveLast();
if( text.Last() == '.' )
if( text.Last() == '.' || text.Last() == sep )
{
text.RemoveLast();
break;
}
}
}
return text;