From MattWiki
Jump to navigation Jump to search
WikiProject Wikipedia (Rated Template-class)
WikiProject iconThis template is within the scope of WikiProject Wikipedia, a collaborative effort to improve Wikipedia's coverage of itself. If you would like to participate, please visit the project page. Please remember to avoid self-references and maintain a neutral point of view on topics relating to Wikipedia.
 Template  This template does not require a rating on the project's quality scale.
WikiProject Time    (Inactive)
WikiProject iconThis template was within the scope of WikiProject Time, a project which is currently considered to be inactive.

Computed version

While the computed version is much simpler there is a problem in the logic. Seemingly at random the expression {{0expr|(({{CURRENTTIMESTAMP}} -30 round -2 ) mod 10000 ) div 100}} will evaluate to a number like -85.16, generally in the range -85 to -95. Likewise if a value like "20060617131818" is plugged in rather than 'CURRENTTIMESTAMP' it evaluates correctly in most cases, but then will at random display a negative value. I'm not sure what is causing this, but the effect can be seen in the two lines below. Just refresh the screen a few times (less than 10 usually) and you should see the values inexplicably go negative.


Since this happens even with hard-coded text (the second line above has '20060617131818' manually plugged into the formula) it would seem to be a problem with the mathematical evaluation within the 0expr template. The same thing happens with 'CURRENTHOUR'. --CBD 13:23, 17 June 2006 (UTC)

Update - I changed this and 'CURRENTHOUR' to use 'CURRENTTIMESTAMP', but breaking down to the relevant section through subtraction rather than modulus division. The 'negative result' problem is caused by modulus division of large values:
{{#expr: 20060617131818 mod 10}} = 8
The above demonstrates the simplest form of the problem. Refreshing will eventually show a negative result. --CBD 21:46, 17 June 2006 (UTC)

Could this bug be fixed? --Meno25 15:09, 26 November 2006 (UTC)

I'm going to assume that the bug has been fixed, because I refreshed 15 times cleared the cache 10 times, and clicked the discussion button 7 times. YamakiriTC 09-30-2007•17:38:07

Edit request

{{editprotected}} Please update {{/doc}} with {{documentation}}. Per Wikipedia:Template documentation/List Thankyou. -- αŁʰƏЩ @ 05:53, 28 April 2008 (UTC)

Done. – Luna Santin (talk) 08:43, 28 April 2008 (UTC)