wownero-python/monero/numbers.py

10 lines
207 B
Python
Raw Normal View History

2017-11-25 22:59:32 +00:00
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)