wiliamvj
wiliamvj

Reputation: 105

How to convert int32 to float javascript

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.

Upvotes: -2

Views: 118

Answers (1)

TopchetoEU
TopchetoEU

Reputation: 694

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.

Upvotes: 0

Related Questions