More discriminatory test for 2-1/2 digits after decimal.

This commit is contained in:
Jeff Young 2025-08-03 23:16:11 +01:00
parent 34e075e112
commit 918f0ec6af

View File

@ -462,9 +462,10 @@ wxString EDA_UNIT_UTILS::UI::MessageTextFromValue( const EDA_IU_SCALE& aIuScale,
if( short_form && aUnits == EDA_UNITS::MM )
{
struct lconv* lc = localeconv();
int length = (int) text.Length();
if( text.Contains( *lc->decimal_point ) && text.EndsWith( '0' ) )
text = text.Left( text.size() - 1 );
if( length > 4 && text[length - 4] == *lc->decimal_point && text[length - 1] == '0' )
text = text.Left( length - 1 );
}
if( aAddUnitsText )