Is there a function in the standard Ruby library or in ActiveSupport which works like this?
f("1.5") == 1.5
f("1") == 1 # Not 1.0
f("1.0") == 1.0
Of course I can easily write my own, but wanted to ask in case I overlooked a built-in solution.
Is there a function in the standard Ruby library or in ActiveSupport which works like this?
f("1.5") == 1.5
f("1") == 1 # Not 1.0
f("1.0") == 1.0
Of course I can easily write my own, but wanted to ask in case I overlooked a built-in solution.
Copyright © 2021 Jogjafile Inc.