How can one get the decimal values of a float and turn it into an integer in ruby?
Here is how far I got so far:
number = 12.55
decimal_length = number.to_s.split('.').size #=> 2
decimal = number.divmod(1).round(decimal_length) #=> 0.55
Maybe I'm misunderstanding? But you've got it you're just doing extra work.
number = 12.55 number.to_s.split('.').to_i # => 55