Created
April 7, 2011 12:38
-
-
Save jveldboom/907680 to your computer and use it in GitHub Desktop.
find the a range in between two numbers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getMiddleRange(min,max,limit,type) | |
{ | |
--limit; | |
var new_num | |
var data = ''; | |
for(var x=0; x<=limit; x++) | |
{ | |
var new_num = Math.ceil((max - min) / limit); | |
new_num = min + (new_num * x); | |
if(x==0){new_num = min;} | |
if(x==limit){new_num = max;} | |
if(type == 'date'){new_num = formatDate(new_num);} | |
data += '|'+new_num; | |
} | |
return data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment