You can also do:
function absFloor(num, pos) {
num += '';
var len = num.length;
if (pos < len) {
return num.substring(0,len-pos) + ('' + Math.pow(10, pos)).substring(1);
}
}
It can be reduced to two lines, but I think the test is important:
function absFloor(num, pos) {
num += '';
return num.substring(0,num.length-pos) + ('' + Math.pow(10, pos)).substring(1);
}