Skip to content

Commit

Permalink
Remove exponent form from amount in to_json
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytro-samoylenko committed Aug 6, 2024
1 parent 86cf84e commit 7b37bde
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions shkeeper/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from shkeeper import db
from shkeeper.modules.rates import RateSource
from shkeeper.modules.classes.crypto import Crypto
from .utils import format_decimal
from .utils import format_decimal, remove_exponent
from .exceptions import NotRelatedToAnyInvoice


Expand Down Expand Up @@ -202,9 +202,9 @@ def to_json(self):
return {
'txs': [tx.to_json() for tx in (*self.transactions, *self.unconfirmed_transactions)],
'external_id': self.external_id,
'balance_fiat': self.balance_fiat,
'balance_fiat': remove_exponent(self.balance_fiat),
'fiat': self.fiat,
'amount_fiat': self.amount_fiat,
'amount_fiat': remove_exponent(self.amount_fiat),
'status': self.status.name,
}

Expand Down Expand Up @@ -314,7 +314,7 @@ class UnconfirmedTransaction(db.Model):

def to_json(self):
return {
'amount': self.amount_crypto,
'amount': remove_exponent(self.amount_crypto),
'crypto': self.crypto,
'addr': self.addr,
'txid': self.txid,
Expand Down Expand Up @@ -375,7 +375,7 @@ def __repr__(self):

def to_json(self):
return {
'amount': self.amount_crypto,
'amount': remove_exponent(self.amount_crypto),
'crypto': self.crypto,
'addr': self.addr,
'txid': self.txid,
Expand Down

0 comments on commit 7b37bde

Please sign in to comment.