nStr = 12.00;
alert(typeof(nStr));// getting number
x = nStr.split('.');
// Other than string Split function Through an error,
nStr = 12.00;
nStr += '';
alert(typeof(nStr));// getting string
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
alert(x1+x2);
//Expected Output is 12.00
I got the temp output coding ( its not optimized coding)
nStr += '';
x = nStr.split('.');
x1 = x[0];
x[1]= (x[1].length == 1) ? '.' + x[1] + '0' : '.' + x[1];
x2 = x.length > 1 ? x[1] : '.00';
alert(x1+x2); // 12.00