Here's something I threw together that seems to do the trick.
code:
function fixNums(maxVal){
myString = "";
if(maxVal > 1){
for(i = 0;true;i ++){
if(maxVal < Math.pow(10,i+1)){
for(n = 1;n <= Math.floor(maxVal/Math.pow(10,i));n ++){
myString += n*Math.pow(10,i)+" - ";
}
return myString;
}
}
}else{
for(i = -1;true;i --){
if(maxVal > Math.pow(10,i)){
for(n = 1;n <= Math.floor(maxVal/Math.pow(10,i));n ++){
myString += n*Math.pow(10,i)+" - ";
}
return myString;
}
}
}
}
Hope this helps
Neal




Reply With Quote