This page last changed on Oct 18, 2011 by jed.wheeler@involver.com.
Overview
This filter allows you to determine what percentage of a supplied integer the variable being filtered is, rounded to the nearest whole number.
Attributes
type |
required |
description |
integer |
true |
The integer we want to use as the basis of evaluation for the filtered variable. |
Examples
What percent of 50 is 30?
The following code:
{{ 30 | percentize: 50 }}
Yields the following result:
What percent of 3 is 1?
The following code:
Yields the following result:
FAQ
- Can I specify the number of decimal places to display?
No, this filter returns the result, rounded to the nearest integer.
Related Topics
|