Skip to content

Percentages in Zlv: discounts, tax and change

Calculate percentages in plain language with Zlv: 20% of 150, add or remove tax, find what percent one number is of another, and measure percent change.

Zlv understands percentages the way people write them. You do not need to convert 15% to 0.15 first.

Percent of a number

Live example
Edit the lines and press Run. Evaluated in your browser.

Evaluating…

Adding and removing a percentage

When you add or subtract a percentage from a number, Zlv applies it to that number. 100 + 20% is 120 and $50 - 10% is $45.

Live example
Edit the lines and press Run. Evaluated in your browser.

Evaluating…

Percentage variables

Store a rate in a variable and use it like any other value. Multiplying by a percentage takes that share, and adding it to a number increases the number by that percentage.

Live example
Edit the lines and press Run. Evaluated in your browser.

Evaluating…

What percent is one number of another?

Use as % of, or ask the question directly with is what % of.

Live example
Edit the lines and press Run. Evaluated in your browser.

Evaluating…

Percent change

from to in % measures the change from the first number to the second. A decrease is negative.

Live example
Edit the lines and press Run. Evaluated in your browser.

Evaluating…

More phrases in the desktop app

The desktop engine also understands of with a percentage variable, and a trailing word such as tax after the percentage:

Desktop example
Uses the native Rust engine: copy it into Zlv Desktop to see results.

Results appear next to each line in Zlv Desktop. Download it free.

A complete example

Live example
Edit the lines and press Run. Evaluated in your browser.

Evaluating…

Tips

  • 100 + 20% adds 20% of 100. If you want to add the number 0.2 instead, write 100 + 0.2.
  • To show a ratio as a percentage, use as % of rather than dividing and multiplying by 100 yourself.
All guides