Skip to content

Instantly share code, notes, and snippets.

@samgreen
Created May 29, 2012 20:15
Show Gist options
  • Save samgreen/2830439 to your computer and use it in GitHub Desktop.
Save samgreen/2830439 to your computer and use it in GitHub Desktop.
var testDecimal = numerator / denominator;
if(testDecimal < .1){
numerator = 0;
denominator = 1;
}
else if(testDecimal > .29 && testDecimal < .35){
numerator = 1;
denominator = 3;
}
else if(testDecimal > .59 && testDecimal < .70){
numerator = 2;
denominator = 3;
}
else if(testDecimal > .98){
numerator = 0;
denominator = 1;
if(whole){
whole++;
}
else{
whole = 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment