mirror of
https://github.com/neocities/neocities.git
synced 2025-07-21 18:16:07 +02:00
Update stats to show site hits and views
This commit is contained in:
parent
e44e4ffcb7
commit
976a9728b3
3 changed files with 20 additions and 6 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue