do not allow unneeded precision
This commit is contained in:
parent
53b74689a1
commit
0ac3ac8d61
|
@ -39,15 +39,14 @@ def format_satoshis(x):
|
||||||
def numbify(entry, is_int = False):
|
def numbify(entry, is_int = False):
|
||||||
text = entry.get_text().strip()
|
text = entry.get_text().strip()
|
||||||
s = ''.join([i for i in text if i in '0123456789.'])
|
s = ''.join([i for i in text if i in '0123456789.'])
|
||||||
entry.set_text(s)
|
|
||||||
|
|
||||||
#entry.set_text( str( Decimal( amount ) / 100000000 ) )
|
|
||||||
|
|
||||||
if not is_int:
|
if not is_int:
|
||||||
|
p = s.find(".")
|
||||||
|
s = s[:p+9]
|
||||||
try:
|
try:
|
||||||
amount = int( Decimal(entry.get_text()) * 100000000 )
|
amount = int( Decimal(s) * 100000000 )
|
||||||
except:
|
except:
|
||||||
amount = 0
|
amount = 0
|
||||||
|
entry.set_text(s)
|
||||||
return amount
|
return amount
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue