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

Arrrrrrhhhhgggg xen:calc

Marc

Well-known member
#1
Please could someone explain why this is wrong.

{xen:number {xen:calc '500000 - {xen:number $boardTotals.messages}'}}

I have 472906 messages on the forum ....... Yet the calculation above somehow gives me 499528
 

Marc

Well-known member
#3
Nope ..... this is from the stats area of the forum

{xen:number $boardTotals.messages}

Which I want to edit to say how many we have to go until we hit 500,000 ...... So basically want 500,000 - {xen:number $boardTotals.messages} which I thought is what the above would give me LOL ....... However just seems like a random number LMAO
 

Marc

Well-known member
#4
Hang on .. lookin at this logically Im guessing its because of the comma. However I cant remove the inner formatting as it doesnt work so I need to format the number as a plain string?
 

Brogan

XenForo moderator
Staff member
#5
I tried it with a comma (adding xen:number) and got a totally different result.

Still incorrect though.

I can't work out what it's doing.
 

Marc

Well-known member
#6
Driving me nuts .... I'll fix it if it kills me ...... Not even because I want it now, but because its bugging me LOL
 

Mikey

Well-known member
#8
I do wonder if we can utilise the {xen:} syntax in the new notices system..


WOOOHOOOOO

{xen:number {xen:calc '500000 - {xen:raw $boardTotals.messages}'}}

Just incase anyone else needs
Which template did you use it in? Not working here :/
 
R

ragtek

Guest
#9
I do wonder if we can utilise the {xen:} syntax in the new notices system..

Which template did you use it in? Not working here :/
Public: Index and there are some places in the acp where it's working

grep 'boardTotals' ;)