sim: fix trailing zero removal

This commit is contained in:
Tomasz Wlostowski 2016-08-11 14:42:01 +02:00 committed by Maciej Suminski
parent bba57097b7
commit 2bcd8af25c
2 changed files with 8 additions and 5 deletions

View File

@ -221,11 +221,14 @@ SPICE_VALUE SPICE_VALUE::operator/( const SPICE_VALUE& aOther ) const
void SPICE_VALUE::stripZeros( wxString& aString ) void SPICE_VALUE::stripZeros( wxString& aString )
{ {
while( aString.EndsWith( '0' ) ) if ( aString.Find(',') >= 0 || aString.Find('.') >= 0 )
aString.RemoveLast(); {
while( aString.EndsWith( '0' ) )
aString.RemoveLast();
if( aString.EndsWith( '.' ) || aString.EndsWith( ',' ) ) if( aString.EndsWith( '.' ) || aString.EndsWith( ',' ) )
aString.RemoveLast(); aString.RemoveLast();
}
} }

View File

@ -47,7 +47,7 @@ public:
}; };
SPICE_VALUE() SPICE_VALUE()
: m_base( 0 ), m_prefix( PFX_NONE ) : m_base( 0 ), m_prefix( PFX_NONE ), m_spiceStr( false )
{ {
} }