I' am currently working with the following code. In the console it's throwing
Uncaught TypeError: TotalAccountBalance.indexOf is not a function
I don't know what else to do. Searching didn't help much.
var CurrentPreservedBalance, CurrentGeneralAccountBalance, TotalAccountBalance;
CurrentPreservedBalance = '20.56';
CurrentGeneralAccountBalance = '20.56';
if( CurrentPreservedBalance && CurrentGeneralAccountBalance ){
TotalAccountBalance = +CurrentPreservedBalance + +CurrentGeneralAccountBalance;
console.log( TotalAccountBalance.indexOf('.') );
} else {
$('#total-fnpf-account-balance').val('$0.00');
$('#total-account-balance').val('$0.00');
}
+CurrentPreservedBalance + +CurrentGeneralAccountBalance;
in the middle. ThenTotalAccountBalance.
should work. and that plus in the front as well. Also, remove the quotes from '20.56'