• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

How to use <xen:calc ''> = an integer

cclaerhout

Well-known member
#2
Code:
{xen:calc "round(5 / 2)"}
Output: 3
Code:
{xen:calc "floor(5 / 2)"}
Output: 2
Code:
{xen:calc "ceil(5 / 2)"}
Output: 3

Other functions compatible with the calc helper: abs, max, min, pow.

Check php manual to see what is the effect of these functions. You can also check inside XenForo templates. There are some.
 
#4
Is there some documentation for the different xen:calc functions like 'floor', 'round'. 'ceiling' ? Could someone point me to it... having a hard time finding anything even with some good searches...