Round decimals to 2
This commit is contained in:
parent
35d9a0e910
commit
dacc283e15
1 changed files with 1 additions and 1 deletions
2
app.rb
2
app.rb
|
@ -29,7 +29,7 @@ end
|
||||||
def readable_number(value)
|
def readable_number(value)
|
||||||
numbers.each do |number, symbol|
|
numbers.each do |number, symbol|
|
||||||
if value.to_f / number.to_f > 1
|
if value.to_f / number.to_f > 1
|
||||||
return (value.to_f / number.to_f).to_s + symbol
|
return (value.to_f / number.to_f).round(2).to_s + symbol
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue