get fraction part of a decimal number

Try to use modulo method:

1.23.modulo(1) => 0.23

Read more here: http://www.ruby-doc.org/core-1.9.3/Numeric.html#method-i-modulo

Or you can convert float to integer and substract it from original float value.

1.23 - 1.23.to_i => 0.23

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)