I guess you could call this a noobie problem as well. I’m trying to
divide two numbers by each other…
For example:
<% for element in project.elements %>
Element: <%= horizontal_bar_graph [element.name,
((element.completed_hours / element.hours) * 100)] %>
<% end %>
element.completed_hours == 2
element.hours == 5
(2 / 5) * 100 == 40
However, it returns a total sum of 0. This is incorrect, of course. Why
does it do that?
I tried it with magic numbers instead of the ‘element.whatever’ things,
and 2 / 5 still equalled zero. However, 5 / 2 worked, and so did 0.2 /
0.5. Why is this and how do I get it working??
Thanks in advance, Isaac