is there a reason for math.round *1000 /1000 doesn't make sense
I am looking at this line of code and I cannot make sense of it. This
particular code is javascript, but I eventually would like to make a java
android app.
$("#TxtHalfDot").val(Math.round((60000/bpm)*3*1000)/1000);
//bpm being a user entered value
I understand the process of the math and have been through it with a
calculator many times. However, I can not make sense of the *1000 followed
by /1000.
My Question
Is this a strange behavior of the "math.round" function or is it just
simply not needed. I have seen it a lot but when I look at it I feel it
can be omitted, but I am not a computer...
(60000/bpm) * 3 gives the same result ((60000/bpm) *3*1000)/1000
No comments:
Post a Comment