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

Arrrrrrhhhhgggg xen:calc

Discussion in 'XenForo Development Discussions' started by Marc, Sep 22, 2011.

  1. Marc

    Marc Well-Known Member

    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
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Does the higher figure include soft deleted posts?
  3. Marc

    Marc Well-Known Member

    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
  4. Marc

    Marc Well-Known Member

    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?
  5. Brogan

    Brogan XenForo Moderator Staff Member

    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.
  6. Marc

    Marc Well-Known Member

    Driving me nuts .... I'll fix it if it kills me ...... Not even because I want it now, but because its bugging me LOL
  7. Marc

    Marc Well-Known Member


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

    Just incase anyone else needs
    Mikey and Brogan like this.
  8. Mikey

    Mikey Well-Known Member

    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 :/
  9. ragtek

    ragtek Guest

    Public: Index and there are some places in the acp where it's working

    grep 'boardTotals' ;)
    Mikey likes this.
  10. Marc

    Marc Well-Known Member

    Forum_lists (excuse if names wrong, but ya know the one LOL, at work)

Share This Page