Reputation: 105
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
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