fix stock formatting
This commit is contained in:
parent
6b23fe36f4
commit
551d854fbd
|
@ -28,7 +28,7 @@ def stock(inp):
|
||||||
elif price > ask:
|
elif price > ask:
|
||||||
price = ask
|
price = ask
|
||||||
change = price - open_price
|
change = price - open_price
|
||||||
quote['LastTradePriceOnly'] = price
|
quote['LastTradePriceOnly'] = "%.2f" % price
|
||||||
quote['Change'] = ("+%.2f" % change) if change >= 0 else change
|
quote['Change'] = ("+%.2f" % change) if change >= 0 else change
|
||||||
|
|
||||||
if change < 0:
|
if change < 0:
|
||||||
|
@ -38,7 +38,7 @@ def stock(inp):
|
||||||
|
|
||||||
quote['PercentChange'] = 100 * change / (price - change)
|
quote['PercentChange'] = 100 * change / (price - change)
|
||||||
|
|
||||||
ret = "%(Name)s - %(LastTradePriceOnly).2f " \
|
ret = "%(Name)s - %(LastTradePriceOnly)s " \
|
||||||
"\x03%(color)s%(Change)s (%(PercentChange).2f%%)\x03 " \
|
"\x03%(color)s%(Change)s (%(PercentChange).2f%%)\x03 " \
|
||||||
"Day Range: %(DaysRange)s " \
|
"Day Range: %(DaysRange)s " \
|
||||||
"MCAP: %(MarketCapitalization)s" % quote
|
"MCAP: %(MarketCapitalization)s" % quote
|
||||||
|
|
Loading…
Reference in New Issue