Round
round — Rounds a number to the specified precision.
<?php
$tplix->assign('amount',3.141592);
Basic Usage:
{$amount|round}
Parameters:| Parameter | Type | Required | Description |
|---|---|---|---|
| 1 | int | No | precision (defaults to 0) |
Where the template is:
//simple display
{$amount}
//display without percision
{$amount|round}
//display with percision
{$amount|round:2}
Output:
3.141592
3
3.14