How do i fix the error odd.split is not a function at Payment.redot
here is my code in typescript or ts, i am using angular.
redot(odd){
let o = odd.split('.');
let decimal = '';
if(typeof o[1] != 'undefined'){
decimal = o[1];
decimal = decimal.replace('%', '');
if(decimal.length > 2){
decimal = decimal.substr(0, 2) + '...%';
} else {
decimal += '%';
}
}
return o[0] + '.' + decimal;
}