Update stats to show site hits and views

This commit is contained in:
Kyle Drake 2015-04-06 17:16:15 -07:00
parent e44e4ffcb7
commit 976a9728b3
3 changed files with 20 additions and 6 deletions

View file

@ -21,6 +21,10 @@ class Numeric
end
end
def to_comma_separated
self.to_s.chars.to_a.reverse.each_slice(3).map(&:join).join(",").reverse
end
def format_large_number
if self > 9999
if self > 999999999
@ -33,7 +37,7 @@ class Numeric
unit_char = 'K' #thousand
unit_amount = 1000.0
end
self_divided = self.to_f / unit_amount
self_rounded = self_divided.round(1)