How to convert integer to float in Ruby

1 Answer

0 votes
a = 829
b = a.to_f

puts b
puts "#{a.class}\n#{b.class}"


# run:
# 
# 829.0
# Integer
# Float
#

 



answered Dec 21, 2020 by avibootz

Related questions

...