shibasankar behera

shibasankar behera

  • NA
  • 117
  • 99.2k

add two decimal numbers in jquery

Mar 5 2015 6:09 AM
I am getting values from textbox and adding. instead of addition result, it is returning Concatination result. Please Help me out of this problem.

My code is bellow


var FBTL = parseFloat($("#txtFBTotalIntake").val()).toFixed(2) +
parseFloat($("#txtFBPumpPrime").val()).toFixed(2)+
arseFloat($("#txtFBCrystalloid").val()).toFixed(2) +
parseFloat($("#txtFBBlood").val()).toFixed(2);
 
I am entering 10, 0 , 0, 0 respectively,
And its returning 10.000.000.000.00 

Answers (2)