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:

60

What percent of 3 is 1?

The following code:

{{ 1 | percentize: 3 }}

Yields the following result:

33

FAQ

  1. Can I specify the number of decimal places to display?
    No, this filter returns the result, rounded to the nearest integer.

Related Topics

Document generated by Confluence on Feb 12, 2013 09:09