Skip to content
Snippets Groups Projects
Commit 412a750d authored by inso's avatar inso
Browse files

Fix display issue with base one in transfer dialog

parent c705c805
No related branches found
No related tags found
No related merge requests found
......@@ -94,7 +94,10 @@ class TransferController(QObject):
dialog.refresh()
current_base = dialog.model.current_base()
if current_base > 1:
current_base_amount = resent_transfer.amount / pow(10, resent_transfer.amount_base - current_base)
else:
current_base_amount = resent_transfer.amount
relative = dialog.model.quant_to_rel(current_base_amount / 100)
dialog.view.set_spinboxes_parameters(current_base_amount / 100, relative)
......
......@@ -33,7 +33,10 @@ class TransferModel(QObject):
:rtype: int
"""
dividend, base = self._blockchain_processor.last_ud(self.connection.currency)
if base > 1:
amount = rel_value * dividend
else:
amount = rel_value * dividend * 10**base
# amount is rounded to the nearest power of 10 depending of last ud base
# rounded = int(pow(10, base) * round(float(amount) / pow(10, base)))
return int(amount) / 100
......@@ -45,7 +48,10 @@ class TransferModel(QObject):
:rtype: float
"""
dividend, base = self._blockchain_processor.last_ud(self.connection.currency)
if base > 1:
relative = amount * 100 / dividend
else:
relative = amount * 100 / (dividend * 10**base)
return relative
def wallet_value(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment