How to use float type with whole number value ?

If the number being represented is a whole number, it is converted into an integer:

       var floatNum = 1.0; 

       document.writeln(floatNum);