From Uncyclopedia, the content-free encyclopedia

Jump to: navigation, search

This template is designed to get three digits out of any number and return the value as an amount less than 1000.

For instance, if given the number 1,234,567 and you are want to obtain the value of the last 3 digits only, you would use the following:

{{3Dig|1|1234567}} = 567

If you wanted to know the value of the 4th, 5th and 6th digit (from the right) you would do the following:

{{3Dig|4|1234567}} = 234

This is designed to work with {{Get}} and {{Goto}} to allow multiple options on a page. For instance if you were to use {{Goto}} to create an page number like so.

Go to page 9876543210

After clicking that link you would have 9876543210 as your result. At the moment the current value is 0

So using {{3Dig}} we can create {{3Dig|4|{{get}}}} as an example, which gives a result at present of 0

If using this on a scoreboard, for example, you could do the following.

|Player 1
|Player 2
|{{Goto|{{#expr:({{3Dig|4|{{get}}}}*1000)+{{#expr:({{3Dig|1|{{get}}}} +15) mod 1000}}}}|Add 15 to Player 1}}
|{{Goto|{{#expr:({{#expr:({{3Dig|4|{{get}}}} +15) mod 1000}}*1000)+{{3Dig|1|{{get}}}}}}|Add 15 to Player 2}}
|colspan="2"|{{Goto|0|Reset Scoreboard|font-weight:bold}}

Which would return:

Player 1 Player 2
0 0
Add 15 to Player 1 Add 15 to Player 2
Reset Scoreboard
Personal tools