From 5a3bad51d0a054956e156f08d4a8d4ab3d20eb5f Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 14 Jun 2024 15:16:11 +0100 Subject: [PATCH] Don't use SI prefixes with degrees when auto-ranging. Fixes https://gitlab.com/kicad/code/kicad/-/issues/18205 --- eeschema/sim/spice_value.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/eeschema/sim/spice_value.cpp b/eeschema/sim/spice_value.cpp index 68765fc8d1..43eda07954 100644 --- a/eeschema/sim/spice_value.cpp +++ b/eeschema/sim/spice_value.cpp @@ -225,8 +225,16 @@ wxString SPICE_VALUE::ToString( const SPICE_VALUE_FORMAT& aFormat ) if( range.StartsWith( wxS( "~" ) ) ) { - Normalize(); - range = si_prefix( m_prefix ) + range.Right( range.Length() - 1 ); + // 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(); + range = si_prefix( m_prefix ) + range.Right( range.Length() - 1 ); + } } else {