From c0114f8e7949c51ec9387b0afddced3c360e5e00 Mon Sep 17 00:00:00 2001 From: ferretinjapan Date: Thu, 4 May 2017 00:21:17 +0930 Subject: [PATCH] Add +/- percentage change to ASP value. --- trifling.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/trifling.py b/trifling.py index e7881b4..8e00279 100644 --- a/trifling.py +++ b/trifling.py @@ -426,7 +426,12 @@ def asp(bot, trigger): value_ripple = float(last_ripple*27962.37965895) value_zcash = float(last_zcash*16.47649534) total = value_dash + value_decred + value_factom + value_golem + value_maidsafecoin + value_augur + value_stellar + value_nem + value_ripple + value_zcash + percent = (((stamp_price * total) / 14950)-1)*100 + if percent >= 0: + sign = '+' + else: + sign = '-' - bot.say("{0} {1:.3f}BTC; {2} {3:.3f}BTC; {4} {5:.3f}BTC; {6} {7:.3f}BTC; {8} {9:.3f}BTC; {10} {11:.3f}BTC; {12} {13:.3f}BTC; {14} {15:.3f}BTC; {16} {17:.3f}BTC; {18} {19:.3f}BTC; ASP Total: {20:.3f}BTC ({21:,.1f}USD) (02-May-17 outlay, 10 BTC@14,950 USD)".format("DASH", value_dash, "DCR", value_decred, "FCT", value_factom, "GNT", value_golem, "MAID", value_maidsafecoin, "REP", value_augur, "STR", value_stellar, "XEM", value_nem, "XRP", value_ripple, "ZEC", value_zcash, total, stamp_price * total)) + bot.say("{0} {1:.3f}BTC; {2} {3:.3f}BTC; {4} {5:.3f}BTC; {6} {7:.3f}BTC; {8} {9:.3f}BTC; {10} {11:.3f}BTC; {12} {13:.3f}BTC; {14} {15:.3f}BTC; {16} {17:.3f}BTC; {18} {19:.3f}BTC; ASP Total: {20:.3f}BTC ({21:,.1f}USD {22}{23:.2f}%) (02-May-17 outlay, 10 BTC@14,950 USD)".format("DASH", value_dash, "DCR", value_decred, "FCT", value_factom, "GNT", value_golem, "MAID", value_maidsafecoin, "REP", value_augur, "STR", value_stellar, "XEM", value_nem, "XRP", value_ripple, "ZEC", value_zcash, total, stamp_price * total, sign, percent)) except: bot.say("ERROR!")