I am currently working with the following code. In the console, he throws
Uncaught TypeError: TotalAccountBalance.indexOf is not a function
I do not know what else to do. The search did not 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'); }
source share