var firstValue=4.3;var secondValue=3.8;
console.log("The first Value="+parseFloat(firstValue).toFixed(1)+" The
second Value="+parseFloat(secondValue).toFixed(1))var result =parseFloat(firstValue).toFixed(1)-parseFloat(secondValue).toFixed(1);
console.log("Result is="+result);
JavaScript
要运行上述程序,你需要使用以下命令—-。
node fileName.js.
Bash
在这里,我的文件名是demo309.js。
输出
这将产生以下输出 —
PS C:\Users\Amit\javascript-code> node demo309.js
The first Value=4.3The second Value=3.8Resultis=0.5