PDA

View Full Version : Doing maths with variables.


Seductor
08-24-2012, 09:29 AM
Hello:

Lets say I have {vb:raw post.somenumber} and {vb:raw post.anothernumber}. How could I sum both numbers and display it?

I thought about something like {vb:raw post.somenumber + post.anothernumber}, but it didn't work.

How could I do it?
Thanks.

kh99
08-24-2012, 11:19 AM
There is a {vb:math } curly tag, but I seem to remember trying to use it and finding that it only worked with constants. If that doesn't work, there's nothing you can do except do the math in php in a plugin.

Edit: I might be wrong - I searched all templates for vb:math and found this example:
{vb:math {vb:raw blockheight}*{vb:stylevar mid_fontSize}+{vb:stylevar mid_fontSize}*2}

Seductor
08-24-2012, 12:46 PM
It worked! Thansk!