Fork me on GitHub

Pagesetter: Calculations in Templates  Bottom

  • Ok, this cant be that hard can it?

    I have 2 fields in my publication that I want to muliply for display on a page. Fields are $qty and $cost. I have looked all over and cant find anything. Any tips? Remember, I am not trying to store the value, just calc for disply on the page.
  • That's really a Smarty question. So I did a little search on http://www.smarty.net and it came up with the math function:
    http://smarty.php.ne…e.function.math.php

    So in PostNuke that would be something like:

    Code

    <!--[math equation="x + y" x=$height y=$width]-->
  • Dude thats awesome, THANKS!!

    other quikie on it, is how can I format my result? Looking for a 2 decial result.
  • Well.. I did post those links for a purpose.. :mrgreen: but waht the hay:

    http://smarty.php.ne…r.string.format.php
  • I found it.... :mrgreen:

    I wasnt thinking, that it was all part of the same Smarty tag....

    its what I get for beeing a n00b I guess icon_lol

This list is based on users active over the last 60 minutes.