mirror of
https://git.wownero.com/lza_menace/wownero-python.git
synced 2024-08-15 03:25:25 +00:00
Add number conversion
This commit is contained in:
parent
bbeb7d85a2
commit
0952fe0893
4 changed files with 27 additions and 0 deletions
9
monero/numbers.py
Normal file
9
monero/numbers.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
from decimal import Decimal
|
||||
|
||||
PICONERO = Decimal('0.000000000001')
|
||||
|
||||
def to_atomic(amount):
|
||||
return int(amount * 10**12)
|
||||
|
||||
def from_atomic(amount):
|
||||
return (Decimal(amount) * PICONERO).quantize(PICONERO)
|
Loading…
Add table
Add a link
Reference in a new issue