I want to get specified format number.. help me plz..
I made function
function ceilingAbsolute(inVal, pos){
var digits = Math.pow(10, pos);
var num = 0;
var patten = "[0-9]{"+pos+"}$";
var re = new RegExp(patten, "");
num = inVal.replace(re);
num = num * digits;
return num;
}
var testVal = ceilingAbsolute(255555, 3) ;
I have expected testVal = 255000, but got "255undefined" ..
I want to get ceiling deciaml number..
somebody help please..