My integer value is like below and
var amount= 5501;
var amount= 5500;
var amount= 5560;
var amount= 5563;
var amount= 5510;
i want split this integer like below .Have to add decimal point on middle. if last digit 0 not consider.
amount and should come "55.0.1" amount and should come "55.0" amount and should come "55.6" amount and should come "55.6.3" amount and should come "55.1"
i tried this ,
var variable1 = 5500;
function versionss(variable1){
var digits = (""+variable1).split("");
if(Number(digits[3] > 0)){
return Number(variable1/100) ; //
} else {
return digits[0]+digits[1]+'.'+digits[2];
}
}