diff --git a/electrum/gui/qt/settings_dialog.py b/electrum/gui/qt/settings_dialog.py index e895d17af..1db118e6b 100644 --- a/electrum/gui/qt/settings_dialog.py +++ b/electrum/gui/qt/settings_dialog.py @@ -225,6 +225,17 @@ class SettingsDialog(WindowModalDialog): unit_combo.currentIndexChanged.connect(lambda x: on_unit(x, nz)) gui_widgets.append((unit_label, unit_combo)) + thousandsep_cb = QCheckBox(_("Add thousand separators to bitcoin amounts")) + thousandsep_cb.setChecked(bool(self.config.get('amt_add_thousands_sep', False))) + def on_set_thousandsep(v): + checked = v == Qt.Checked + if self.config.amt_add_thousands_sep != checked: + self.config.amt_add_thousands_sep = checked + self.config.set_key('amt_add_thousands_sep', checked) + self.window.need_update.set() + thousandsep_cb.stateChanged.connect(on_set_thousandsep) + gui_widgets.append((thousandsep_cb, None)) + qr_combo = QComboBox() qr_combo.addItem("Default", "default") msg = (_("For scanning QR codes.") + "\n" diff --git a/electrum/simple_config.py b/electrum/simple_config.py index 862f9d946..2c207db07 100644 --- a/electrum/simple_config.py +++ b/electrum/simple_config.py @@ -111,6 +111,7 @@ class SimpleConfig(Logger): self.decimal_point = DECIMAL_POINT_DEFAULT self.num_zeros = int(self.get('num_zeros', 0)) self.amt_precision_post_satoshi = int(self.get('amt_precision_post_satoshi', 0)) + self.amt_add_thousands_sep = bool(self.get('amt_add_thousands_sep', False)) def electrum_path(self): # Read electrum_path from command line @@ -659,7 +660,7 @@ class SimpleConfig(Logger): except: pass - def format_amount(self, x, is_diff=False, whitespaces=False, add_thousands_sep=True): + def format_amount(self, x, is_diff=False, whitespaces=False): return format_satoshis( x, num_zeros=self.num_zeros, @@ -667,7 +668,7 @@ class SimpleConfig(Logger): is_diff=is_diff, whitespaces=whitespaces, precision=self.amt_precision_post_satoshi, - add_thousands_sep=add_thousands_sep, + add_thousands_sep=self.amt_add_thousands_sep, ) def format_amount_and_units(self, amount):