Hey,
I've been superbusy so I haven't gotten round to thank you.
Well thank you ... it works like a charm.
I've modified it at bit so that it returns an array
Can you help me out with returning an array based on both a maxValue and a minValue?Code:// proto that returns an array of genericly rounded values based on maxVal Array.prototype.getValueArray=function(maxVal){ var maxVal=maxVal var arrTemp = new Array() arrTemp[0]=0 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)+" - "; arrTemp.push(n*Math.pow(10,i)) } return arrTemp; } } }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)+" - "; arrTemp.push(n*Math.pow(10,i)) } return arrTemp; } } } }
The minimum value should be able to handle negative values.
Thanks again ... hope to hear from you
//poden




Reply With Quote