I found a very strange issue, the issue is the ROUND method in PHP and Javascript the calculation results are not the same!?
See the following example:
PHP>
That's not an issue, it is well documented
If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞. Note that this differs from many languages' round() functions, which often round this case to the next integer away from zero, instead (giving a different result in the case of negative numbers with a fractional part of exactly 0.5).
If you want the same behaviour on Javascript, I would use
var n = -175.5;
var round = Math.round(Math.abs(n))*(-1)