0
How come that 10/2=5.0 not 5?
little bit confused here.
4 Answers
+ 3
JavaScript doesn't have a datatype defined on their own so it will always show a decimal part by default..
+ 2
parseFloat(10/2).toFixed(1)
+ 1
Javascript doesn't have an Integer, Float, Double, etc type on their own. All these types are part of the Number type. So the decimal part to the division will usually be displayed by default.
+ 1
That's okay. Decimals .0 are same as normal integers.