Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1a4693f

Browse files
simplewallet basic example 3 edited
1 parent 2476b65 commit 1a4693f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/simplewallet_basic_rpc_call_03.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,22 @@ def main():
4040
# amounts in cryptonote are encoded in a way which is convenient
4141
# for a computer, not a user. Thus, its better need to recode them
4242
# to something user friendly, before displaying them.
43+
#
44+
# For examples:
45+
# 4760000000000 is 4.76
46+
# 80000000000 is 0.08
47+
#
4348
if "result" in response_json:
4449
if "transfers" in response_json["result"]:
4550
for transfer in response_json["result"]["transfers"]:
4651
transfer["amount"] = float(get_money(str(transfer["amount"])))
4752

53+
4854
# pretty print json output
4955
print(json.dumps(response_json, indent=4))
5056

5157
def get_money(amount):
52-
"""decode cryptonote amount format to user friendly format"""
58+
"""decode cryptonote amount format to user friendly format. Hope its correct."""
5359

5460
CRYPTONOTE_DISPLAY_DECIMAL_POINT = 12
5561

0 commit comments

Comments
 (0)