Convert string to decimal number in ruby March 7, 2023 by Tarik You call to_i, you get integer. Try calling to_f, you should get a float. For more string conversion methods, look here.