vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=287013

Doing maths with variables.
by Seductor
24 Aug 2012 11:29

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 24 Aug 2012 13:19

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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Seductor 24 Aug 2012 14:46

It worked! Thansk!


All times are GMT. The time now is 20:16.

Powered by vBulletin® Version 3.8.14
Copyright © 2020, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.