|
@ -96,6 +96,16 @@ class ElectrumWindow(App): |
|
|
'''Number of zeros used while representing the value in base_unit. |
|
|
'''Number of zeros used while representing the value in base_unit. |
|
|
''' |
|
|
''' |
|
|
|
|
|
|
|
|
|
|
|
def get_amount_text(self, amount_str, is_fiat): |
|
|
|
|
|
text = amount_str + ' ' + self.base_unit if amount_str else '' |
|
|
|
|
|
if text: |
|
|
|
|
|
amount = self.get_amount(text) |
|
|
|
|
|
x = run_hook('format_amount_and_units', amount) |
|
|
|
|
|
if x: |
|
|
|
|
|
text += ' / ' + x |
|
|
|
|
|
return text |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_amount(self, amount_str): |
|
|
def get_amount(self, amount_str): |
|
|
a, u = amount_str.split() |
|
|
a, u = amount_str.split() |
|
|
assert u == self.base_unit |
|
|
assert u == self.base_unit |
|
|