# Start Searching the Answers

The Internet has many places to ask questions about anything imaginable and find past answers on almost everything.

The Question & Answer (Q&A) Knowledge Managenet

The Internet has many places to ask questions about anything imaginable and find past answers on almost everything.

Table of Contents

- How do you do percentages in JavaScript?
- What is the formula of calculating percentage?
- What is the formula for calculating?
- How do you find the percentage decrease between two numbers?
- How do I find the percentage of one number to another?
- What is 60 out of 100 as a percentage?
- What is 30 out of 100 as a percentage?
- What is 70 out of 100 as a percentage?
- What is 60 out of 80 as a percentage?

JavaScript: Calculate the percentage of a number

- Sample Solution:-
- HTML Code:
- JavaScript Code: function percentage(num, per) { return (num/100)*per; } console.log(percentage(1000, 47.12));
- Flowchart:
- Live Demo:
- Improve this sample solution and post your code through Disqus.

We call the first number (2) a numerator and the second number (5) a denominator because this is a fraction. To calculate the percentage, multiply this fraction by 100 and add a percent sign. 100 * numerator / denominator = percentage . In our example it’s 100 * 2/5 = 100 * 0.4 = 40 .

1. How to calculate percentage of a number. Use the percentage formula: P% * X = Y

- Convert the problem to an equation using the percentage formula: P% * X = Y.
- P is 10%, X is 150, so the equation is 10% * 150 = Y.
- Convert 10% to a decimal by removing the percent sign and dividing by 100: 10/100 = 0.10.

Calculate Percentage Decrease: First, work out the difference (decrease) between the two numbers you are comparing. Next, divide the decrease by the original number and multiply the answer by 100.

Learning how to calculate the percentage of one number vs. another number is easy. If you want to know what percent A is of B, you simple divide A by B, then take that number and move the decimal place two spaces to the right. That’s your percentage!

Therefore the fraction 60/100 as a percentage is 60%.

Therefore the fraction 30/100 as a percentage is 30%.

Therefore the fraction 70/100 as a percentage is 70%.

Percentage Calculator: 60 is what percent of 80? = 75.