lita-onewheel-finance 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/handlers/onewheel_finance.rb +18 -10
- data/lib/lita/handlers/yahoo_quote.rb +1 -2
- data/lita-onewheel-finance.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 705648b5037494e24e403eff8e89f00041e4df73fe32a1948b2a4483a07360ee
|
4
|
+
data.tar.gz: cd5a3b83ae4a98f140d824061c2433146481cec08ce0879c0cd668055cb3d043
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12fa54d511e7bc069bd475d9de53bdae53aa0990fd4790c794b50d36aeaec2f93b1594c609bd5d58de9ab1c5d4b1e99b33814bbb066537b961937196e4f3ccab
|
7
|
+
data.tar.gz: 965db07646a717a3adf927a7c94897ad2c21c93d3e5bc691cb173ca3db1d204eccbc5e4958fcfbc7a73277115e849873fffd90897420321f7dfb337b4f9ef148
|
@@ -41,24 +41,32 @@ module Lita
|
|
41
41
|
|
42
42
|
# IRC mode
|
43
43
|
if config.mode == 'irc'
|
44
|
-
str = "#{IrcColors::grey}#{stock.exchange} - #{IrcColors::reset}#{stock.symbol}: #{IrcColors::blue}#{dollar_sign}#{stock.price}#{IrcColors::reset} "
|
44
|
+
str = "#{IrcColors::grey}#{stock.exchange} - #{IrcColors::reset}#{stock.symbol}: #{IrcColors::blue}#{dollar_sign}#{"%.2f" % stock.price}#{IrcColors::reset} "
|
45
45
|
if stock.change >= 0
|
46
46
|
# if irc
|
47
|
-
str += "#{IrcColors::green} ⬆#{dollar_sign}#{stock.change}#{IrcColors::reset}, #{IrcColors::green}#{stock.change_percent}%#{IrcColors::reset} "
|
48
|
-
|
47
|
+
str += "#{IrcColors::green} ⬆#{dollar_sign}#{"%.2f" % stock.change}#{IrcColors::reset}, #{IrcColors::green}#{stock.change_percent}%#{IrcColors::reset} "
|
48
|
+
if stock.name
|
49
|
+
str += "#{IrcColors::grey}(#{stock.name})#{IrcColors::reset}"
|
50
|
+
end
|
49
51
|
else
|
50
|
-
str += "#{IrcColors::red} ↯#{dollar_sign}#{stock.change}#{IrcColors::reset}, #{IrcColors::red}#{stock.change_percent}%#{IrcColors::reset} "
|
51
|
-
|
52
|
+
str += "#{IrcColors::red} ↯#{dollar_sign}#{"%.2f" % stock.change}#{IrcColors::reset}, #{IrcColors::red}#{stock.change_percent}%#{IrcColors::reset} "
|
53
|
+
if stock.name
|
54
|
+
str += "#{IrcColors::grey}(#{stock.name})#{IrcColors::reset}"
|
55
|
+
end
|
52
56
|
end
|
53
57
|
else
|
54
|
-
str = "#{stock.exchange} - #{stock.symbol}: #{dollar_sign}#{stock.price} "
|
58
|
+
str = "#{stock.exchange} - #{stock.symbol}: #{dollar_sign}#{"%.2f" % stock.price} "
|
55
59
|
if stock.change >= 0
|
56
60
|
# if irc
|
57
|
-
str += " :arrow_up:#{dollar_sign}#{stock.change}, :heavy_plus_sign:#{stock.change_percent}% "
|
58
|
-
|
61
|
+
str += " :arrow_up:#{dollar_sign}#{"%.2f" % stock.change}, :heavy_plus_sign:#{stock.change_percent}% "
|
62
|
+
if stock.name
|
63
|
+
str += "(#{stock.name})"
|
64
|
+
end
|
59
65
|
else
|
60
|
-
str += " :chart_with_downwards_trend:#{dollar_sign}#{stock.change}, :heavy_minus_sign:#{stock.change_percent}% "
|
61
|
-
|
66
|
+
str += " :chart_with_downwards_trend:#{dollar_sign}#{"%.2f" % stock.change}, :heavy_minus_sign:#{stock.change_percent}% "
|
67
|
+
if stock.name
|
68
|
+
str += "(#{stock.name})"
|
69
|
+
end
|
62
70
|
end
|
63
71
|
end
|
64
72
|
end
|
@@ -35,9 +35,8 @@ class YahooQuote
|
|
35
35
|
@change_percent = self.fix_number ((@change / @price) * 100)
|
36
36
|
end
|
37
37
|
|
38
|
-
# Apparently rounding stopped working at some point for trailing 0's
|
39
38
|
def fix_number(price_str)
|
40
|
-
|
39
|
+
price_str.to_f.round(2)
|
41
40
|
end
|
42
41
|
|
43
42
|
def is_index?
|