I am having some data calculation on my client side, which I want to validate on the server end. Let's say my calculated value result is 34.55
(34.55).toFixed(1)
gives me 34.5
Strangely, (34.555).toFixed(1)
gives me 34.6
number_format(34.55, 1, '.', '')
gives me 34.6
Can anyone suggest me an exact equivalent of either of the functions?