Skip to content

Instantly share code, notes, and snippets.

@cbronazc
Created August 12, 2013 22:49
Show Gist options
  • Save cbronazc/6216080 to your computer and use it in GitHub Desktop.
Save cbronazc/6216080 to your computer and use it in GitHub Desktop.
Calculate Innings Pitched with Javascript
base = Math.floor(total);
partial = Math.round((total - base) * 10);
total = (base + Math.floor(partial / 3) + (partial % 3) / 10).toFixed(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment