Browse Source

Remove trailing zeros from all values

If we are showing a value to the end user, we should avoid unneeded
precision
newinvert
Seth Hillbrand 2 years ago
parent
commit
abd0388794
  1. 7
      common/eda_units.cpp

7
common/eda_units.cpp

@ -464,6 +464,13 @@ wxString EDA_UNIT_UTILS::UI::MessageTextFromValue( const EDA_IU_SCALE& aIuScale,
}
text.Printf( format, value );
removeTrailingZeros( text );
if( value != 0.0 && ( text == wxS( "0" ) || text == wxS( "-0" ) ) )
{
text.Printf( wxS( "%.10f" ), value );
removeTrailingZeros( text );
}
if( aAddUnitsText )
text += EDA_UNIT_UTILS::GetText( aUnits, aType );

Loading…
Cancel
Save