Math.Round Is not Working as expected
-
Hello,
I have my calculator setup as such:
quantity_field_id_1
quantity_field_id_2
quantity_field_id_3
quantity_field_id_4Now I have a total field with this formula:
quantity_field_id_1 * quantity_field_id_2 * quantity_field_id_3 * quantity_field_id_4 / 1000This works as such BUT now I need to
round the calculated value, so what I did was this:Math.round( quantity_field_id_1 * quantity_field_id_2 * quantity_field_id_3 * quantity_field_id_4 / 1000 )
Which in theory should work, but for some reason gives an undrounded value.
So, If my initial formula calculation gets this value: 3,742.20
then upon rounding it I should get this: 3,74But I just get the same full value: 3,742.20
I tried doing this:
Math.round(3,742.20)
this gives this: 3.00Which is somewhat close, but I ofcourse need it to square with the
quantity fields not with a hardcoded value.How can I do this?
- The topic ‘Math.Round Is not Working as expected’ is closed to new replies.