Don't use SI prefixes with degrees when auto-ranging.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18205
This commit is contained in:
parent
7b63429fe1
commit
5a3bad51d0
|
@ -224,10 +224,18 @@ wxString SPICE_VALUE::ToString( const SPICE_VALUE_FORMAT& aFormat )
|
||||||
wxString range( aFormat.Range );
|
wxString range( aFormat.Range );
|
||||||
|
|
||||||
if( range.StartsWith( wxS( "~" ) ) )
|
if( range.StartsWith( wxS( "~" ) ) )
|
||||||
|
{
|
||||||
|
// Don't use SI prefixes with degrees unless they specifically ask for it.
|
||||||
|
if( range.EndsWith( wxS( "°" ) ) )
|
||||||
|
{
|
||||||
|
range = range.Right( range.Length() - 1 );
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
Normalize();
|
Normalize();
|
||||||
range = si_prefix( m_prefix ) + range.Right( range.Length() - 1 );
|
range = si_prefix( m_prefix ) + range.Right( range.Length() - 1 );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SPICE_VALUE::UNIT_PREFIX rangePrefix = ParseSIPrefix( range[0] );
|
SPICE_VALUE::UNIT_PREFIX rangePrefix = ParseSIPrefix( range[0] );
|
||||||
|
|
Loading…
Reference in New Issue