try this
low_freq = unsorted.last.freq.to_i
high_freq = unsorted.first.freq.to_i
divider = high_freq / low_freq
On 3/19/06, dave jones <davejones2005@gmail.com>
wrote:>
> Hi all,
> This must be such a beginner''s problem, but I can''t
figure it out.
>
> I''m pulling two integers out of a database, and i want to divide
one
> value with the other, but i keep getting an error about operating on
> strings.
> Here''s the code -
>
> low_freq = unsorted.last.freq
> high_freq = unsorted.first.freq
> divider = high_freq / low_freq
>
>
> In my view, if i display the contents of low_freq or high_freq there is
> indeed an integer in there.
>
> Can someone help a newb?
>
> cheers
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060318/14c807c7/attachment-0001.html