CalculatorsLesson 173Free preview
Percentage Calculator
This lesson is part of Web Developer Tools · All levels
Summary
Percentage Calculator addresses three common questions: what is X percent of Y, what is X percent of Y, and what is the percentage change from the old value to the new value. Percent means per hundred, so X% of Y is calculated by X/100 x Y. For change, for difference with the starting value, not the end value.
Key points
- X% of Y is equal to X/100 x Y
- X of Y is equal to X/Y x 100%
- Change is equal to (recent - long) / long x 100%
- A 10 percentage point increase is different from a 10 percent increase.
- Divisions by zero are undefined
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.