How to convert int32 to float javascript

78 views Asked by At

I need to convert values ​​of type int32 to float values

I have the value of 39900 and I need to convert to 399.00, or 7400 to convert to 74.00 or 4378 to 43.78, they are not fixed values.

1

There are 1 answers

0
TopchetoEU On BEST ANSWER

You just need to divide the number by 100, this will put the last 2 digits in the fractions. You don't need to worry about integer and float weirdness from C-like languages, since in Javascript, all numbers are floats, as @pilchard has pointed out.