Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kevinold/26f1757b05a0e3c4da5492b56b798f0e to your computer and use it in GitHub Desktop.
Save kevinold/26f1757b05a0e3c4da5492b56b798f0e to your computer and use it in GitHub Desktop.
JS Calculate Progress Percentage
var completed = 30;
var target = 30;
var progress = Math.ceil(completed / target * 100);
console.log(progress);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment