Make zero-stripping sensitive to locale separator.
Fixes https://gitlab.com/kicad/code/kicad/issues/5813
This commit is contained in:
parent
6abe68fff0
commit
4165ae6df1
pcbnew
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue