the percentage : Convert to Float « Number « Ruby






the percentage

((1.to_f / 2.to_f) * 100).to_i

 

Related examples in the same category

1.create or convert floating-point numbers with Kernel's Float method
2.Convert string to float
3.try weird conversions