I've been working on the project and just found this. Basically if I multiple the integer value by the some kind of decimal(float) the value I receive is not exact.
For example <%= 800 * 1.1 %>
in the html, returns 880.0000000000001
instead of just 880.
Any possible explanations to why it happens? And is it possible to round the number?
Edit: <%= 800 + (800 * 0.1) %>
works fine
Using the reply below, I've modified code to <%= Float.round(value, 2) %>
, so the value gets rounded to two decimal places