From c954442e441b84ae74a558b321e2ea2a848a0bb3 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 2 Nov 2012 00:40:08 +0000 Subject: [PATCH] Carla: Force saved parameter values to not use scientific notation --- src/shared_carla.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/shared_carla.py b/src/shared_carla.py index 31a481e..d305d4f 100644 --- a/src/shared_carla.py +++ b/src/shared_carla.py @@ -19,6 +19,7 @@ # Imports (Global) import platform, sys from copy import deepcopy +from decimal import Decimal from sip import unwrapinstance from PyQt4.QtCore import pyqtSlot, Qt, QSettings, QTimer from PyQt4.QtGui import QColor, QCursor, QDialog, QFontMetrics, QFrame, QInputDialog, QMenu, QPainter, QVBoxLayout, QWidget @@ -1636,10 +1637,10 @@ class PluginWidget(QFrame, ui_carla_plugin.Ui_PluginWidget): content += "\n" content += " \n" content += " %s\n" % "Yes" if x_save_state_dict['Active'] else "No" - content += " %g\n" % x_save_state_dict['DryWet'] - content += " %g\n" % x_save_state_dict['Volume'] - content += " %g\n" % x_save_state_dict['Balance-Left'] - content += " %g\n" % x_save_state_dict['Balance-Right'] + content += " %f\n" % x_save_state_dict['DryWet'] + content += " %f\n" % x_save_state_dict['Volume'] + content += " %f\n" % x_save_state_dict['Balance-Left'] + content += " %f\n" % x_save_state_dict['Balance-Right'] for parameter in x_save_state_dict['Parameters']: content += "\n" @@ -1650,7 +1651,8 @@ class PluginWidget(QFrame, ui_carla_plugin.Ui_PluginWidget): if parameter['symbol']: content += " %s\n" % xmlSafeString(parameter['symbol'], True) - content += " %g\n" % parameter['value'] + strValue = "{0:f}".format(Decimal("%g" % parameter['value'])) + content += " %s\n" % strValue if parameter['midiCC'] > 0: content += " %i\n" % parameter['midiCC']