Division error!

When I try to make a division account for example 24/48 the result of 0

Does anyone know what can it be?

It’s integer division. Use to_f to make num1 a floating point, i.e. #{num1.to_f / num2}

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs