TPLix

No results for ""

Round

2 min read Jun 2, 2026
--- title: round autoseo: enabled: true theme: learn2 child_type: default admin: children_display_order: collection visible: true ---

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

Leave a Comment

Not published. Used to notify you on approval.

Comments are moderated before appearing.