26,210 Pages

# This Forum has been archived

Forums: Index Support Requests Expression inside an template
FANDOM's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.

Note: This topic has been unedited for 1513 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.

I was wondering how to get this to work:

{{#expr: {{formatnum:{{{Earn}}}|R}} + {{formatnum:{{{EarnB}}}|R}} }}

--Jens Ingels (talk) 18:30, September 30, 2012 (UTC)

What exactly is {{{Earn}}} in this example? It must be a template parameter. Where is the template?

Well that is the template. The idea is when adding this: {{tabber|Earn=90|EarnB=15}}. It gives the results of the formule. The formule system is like this: $Earn + EarnB = Result$ and $Earn + (EarnB/2) = Result$ for levels higher than 10. This is the content where I try to make the formule for:

Level Food
Needed
x 4
/
Minute
HP
1 5 18 1,100
2 10 30 1,200
3 20 42 1,300
4 40 54 1,400
5 80 66 1,500
6 160 78 1,600
7 320 90 1,700
8 640 102 1,800
9 1,280 114 1,900
10 1,664 126 2,000

Level Food
Needed
x 4
/
Minute
HP
11 2,163 132 2,100
12 2,812 138 2,200
13 3,656 144 2,300
14 4,753 150 2,400
15 6,178 156 2,500
16 8,032 162 2,600
17 10,441 168 2,700
18 13,574 174 2,800
19 17,646 180 2,900
20 22,940 186 3,000

Level Food
Needed
x 4
/
Minute
HP
21 29,822 192 3,100
22 38,768 198 3,200
23 50,398 204 3,300
24 65,518 210 3,400
25 85,173 216 3,500
26 110,725 222 3,600
27 143,943 228 3,700
28 187,126 234 3,800
29 243,264 240 3,900
30 316,243 246 4,000

If I can get the template to work they probaly only have to add the small code "{{tabber|Earn=18|EarnB=12}}". The hp system is almost similar. The problem is simply I can get "{{{...}}}" to work inside the expr function.

--Jens Ingels (talk) 15:52, October 2, 2012 (UTC)

Well, the way in which you're using formatnum above doesn't cause any problems so far as I can see. For example, I made a template here and it worked just fine with {{{...}}} inside expr. Can you please link to your work-in-progress template so I can take a closer look at your exact code to further investigate?

I figured out what's wrong. It's the tabber function that make tags like "{{{...}}}" not working. I figured it out when testing your code inside the tabber. All tags went back to default or alternative. For example of the template. Well that table I showed above was the template that I slowly wanted to rebuild with the code.

Now will remain the question if there an fix that can let the expr work in the tabber extension.--Jens Ingels (talk) 08:12, October 3, 2012 (UTC)

Edite: Nvm found the fix, I didn't add the tabber in his Parser functions version.--Jens Ingels (talk) 16:15, October 3, 2012 (UTC)

Community content is available under CC-BY-SA unless otherwise noted.