From a8b127019c8a122cb0b5001b3be88abe229a4a18 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 (cherry picked from commit 5a3bad51d0a054956e156f08d4a8d4ab3d20eb5f) --- 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 1ae26c62c9..c704925c1a 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 {