> 8.2675.modulo(1)

irb(main):015:0> -1.2.modulo(1)
=> 0.8

which may or may not be the result the OP wanted.

Wayne


On Nov 12, 2007 3:11 PM, 7stud -- <bbxx789_05ss / yahoo.com> wrote:
> Jari Williamsson wrote:
> > Is there any built-in method to get the fractional part from a float, or
> > do I need to resolve to a...
> > f - f.to_i
> > ...kind of approach?
> >
>
> If you think it's clearer:
>
> 8.2675.modulo(1)
> --
> Posted via http://www.ruby-forum.com/.
>
>