mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-11-25 12:32:30 +01:00
Refactor rounding
This commit is contained in:
parent
15e8d8b19b
commit
af13a6324a
@ -62,10 +62,6 @@ class Quote
|
|||||||
|
|
||||||
# I'm mimicking the apparent convention of the ECB here.
|
# I'm mimicking the apparent convention of the ECB here.
|
||||||
def round_rate(rate)
|
def round_rate(rate)
|
||||||
if rate > 100
|
Float("%.#{5}g" % rate)
|
||||||
rate.round(2)
|
|
||||||
else
|
|
||||||
Float("%.#{5}g" % rate)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user