From 938859f10ab79f811fe7a16aaaf0940d604e9764 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 30 Nov 2020 13:24:32 -0800 Subject: [PATCH] SPICE export full precision data Saving csv files loses precision when time/data steps are smaller than 10^-6. This switches to engineering notation when dealing with higher precision. Ref KiCad Services ticket 281 --- eeschema/sim/sim_plot_frame.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eeschema/sim/sim_plot_frame.cpp b/eeschema/sim/sim_plot_frame.cpp index ffceefa3df..4a61f34834 100644 --- a/eeschema/sim/sim_plot_frame.cpp +++ b/eeschema/sim/sim_plot_frame.cpp @@ -927,7 +927,7 @@ void SIM_PLOT_FRAME::menuSaveCsv( wxCommandEvent& event ) out.Write( wxString::Format( "Time%c", SEPARATOR ) ); for( double v : trace->GetDataX() ) - out.Write( wxString::Format( "%f%c", v, SEPARATOR ) ); + out.Write( wxString::Format( "%g%c", v, SEPARATOR ) ); out.Write( "\r\n" ); timeWritten = true; @@ -936,7 +936,7 @@ void SIM_PLOT_FRAME::menuSaveCsv( wxCommandEvent& event ) out.Write( wxString::Format( "%s%c", t.first, SEPARATOR ) ); for( double v : trace->GetDataY() ) - out.Write( wxString::Format( "%f%c", v, SEPARATOR ) ); + out.Write( wxString::Format( "%g%c", v, SEPARATOR ) ); out.Write( "\r\n" ); }