Editing User:Fbstj/testing/value-tag
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 19: | Line 19: | ||
; get value after it's set |
; get value after it's set |
||
:<value key="test" /> |
:<value key="test" /> |
||
− | |||
− | ; define total value of pages |
||
− | :<value key="total">{{#expr:<!-- |
||
− | -->{{PAGESINCATEGORY: Complete articles|pages|R}}<!-- |
||
− | --> + {{PAGESINCATEGORY: articles nearing completion|pages|R}}<!-- |
||
− | --> + {{PAGESINCATEGORY: Partially complete articles|pages|R}}<!-- |
||
− | --> + {{PAGESINCATEGORY: Stubs|pages|R}}<!-- |
||
− | -->}}</value><value key="total" /> |
||
− | |||
− | ; define a function <code>ratio($CATEGORY)</code> |
||
− | <calculation name="ratio" arg="category">{{#expr:<!-- |
||
− | -->100 * {{PAGESINCATEGORY: $CATEGORY|pages|R}} / <!-- |
||
− | --> ( {{PAGESINCATEGORY: Complete articles|pages|R}}<!-- |
||
− | --> + {{PAGESINCATEGORY: articles nearing completion|pages|R}}<!-- |
||
− | --> + {{PAGESINCATEGORY: Partially complete articles|pages|R}}<!-- |
||
− | --> + {{PAGESINCATEGORY: Stubs|pages|R}} )<!-- |
||
− | --> round 2}}%</calculation> |
||
− | ; call <code>ratio(complete articles)</code> |
||
− | :<calculation call="ratio" category="complete articles" /> |
||
− | ; call <code>ratio(articles nearing completion)</code> |
||
− | :<calculation call="ratio" category="articles nearing completion" /> |
||
− | ; call <code>ratio(partially complete articles)</code> |
||
− | :<calculation call="ratio" category="partially complete articles" /> |
||
− | ; call <code>ratio(stubs)</code> |
||
− | :<calculation call="ratio" category="stubs" /> |