Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How does js convert var into double and then perform the operation?
How does js convert var into double and then perform the operation?
There is no data type without double type in js.

You can specify to define floating-point numbers. No transfer required:

Then you can directly use a to calculate.

Example:

var a = 12.3333333;

var b = 15.5555555;

alert(a+b); ? //will pop up: 27.88;