Template talk:Round/Archive 1

doc
editprotected Would someone please move the documentation to a doc page? Jɪmp 07:03, 5 February 2008 (UTC)
 * ✅. עוד מישהו Od Mishehu 10:46, 5 February 2008 (UTC)
 * Thanx Jɪmp 17:15, 5 February 2008 (UTC)

Numeric format
editprotected This template seems to use e-notation, eg. 3.5E-5. This is not an acceptable numeric format in print. The template should be edited to use scientific notation: 3.5 × 10-5, rather than 3.5E-5. This template is being used by convert, which introduces occasional uses of e-notation into a wide variety of articles.--Srleffler (talk) 03:33, 4 July 2008 (UTC)
 * I'm working on it. I've requested unprotection. J IM ptalk·cont 05:21, 4 July 2008 (UTC)
 * Hunter's coming to the rescue. (It can't be unprotected since it's transcluded on the main page today, tomorrow, the next day, ...) J IM ptalk·cont 07:08, 4 July 2008 (UTC)
 * ✅, change applied. — Huntster (t • @ • c) 07:10, 4 July 2008 (UTC)

Strange
Thanks. I'm seeing a strange bug, though: in the documentation on the template page itself, the third example renders as
 * " 0.000020004 " gives "Expression error: Unrecognised punctuation character "{"×10Expression error: Unexpected < operator" [3]

The same wikicode works fine at Template:Rnd/doc, but fails when transcluded into the template. --Srleffler (talk) 14:19, 4 July 2008 (UTC)
 * It should go away when the page is saved again (it need not be edited, just saved). J IM ptalk·cont 16:41, 4 July 2008 (UTC)


 * Somebody needs to edit the page, then.--Srleffler (talk) 17:26, 4 July 2008 (UTC)

Something more complex is going on here. I'm looking into it. --- RockMFR 17:35, 4 July 2008 (UTC)
 * One of the template limits is probably being hit, though I can only reproduce it on enwiki, not on my own wiki. For now, I'd suggest not using Template:Xpd. I'm going to look into this more today. --- RockMFR 18:46, 4 July 2008 (UTC)

That seems to have fixed it. J IM ptalk·cont 17:46, 6 July 2008 (UTC)

Overhaul
The overhaul of this template is all but complete. The following is the new code for the main template page. This will increase the template's upper bound for regular notation (as opposed to scientific notation) from 100,000 to 1,000,000,000 as discussed on Template talk:Convert.
 * ✅ Thanks, PeterSymonds (talk)  06:55, 10 July 2008 (UTC)

0

Once this code is added the following subtemplates will no longer be transcluded.



Please unprotect them. This will allow them to be recycled (preserving page history) for the purpose of extending the range of into negative numbers. Also please add to  Category:Subtemplates of Template Rnd.

J IM ptalk·cont 04:55, 10 July 2008 (UTC)
 * ✅ Thanks, PeterSymonds (talk)  07:03, 10 July 2008 (UTC)


 * I had to restore Template:Rnd/e0. Deleting it broke Template:Infobox Ice Hockey Player (specifically the weight part). If someone knows how to fix it, feel free.-Wafulz (talk) 12:49, 10 July 2008 (UTC)


 * Yeah, sorry about that. I neglected to update convert/rand to take account of this overhaul.  It was calling .  I reckon I've fixed it now though.  The "What links here" for  is still showing a bunch of articles but they seem to be old transclusions (resave and the transclusion vanishes).  However, instead of deleting it right away, we might be safest to leave a redirect until the "What links here" list is empty.  Don't have it go to, though, that'll just give you nonsense (unless we actually are dealing with numbers equal to or less than minus one thousand million).  Send it straight to rnd.  J IM ptalk·cont 02:35, 11 July 2008 (UTC)

Okay, is ready for deletion again: the ghost links are gone. J IM ptalk·cont 18:24, 14 July 2008 (UTC)


 * Looks like this has already been deleted by, I'll mark as ✅. — Huntster (t • @ • c) 22:37, 14 July 2008 (UTC)

More strangeness
There seems to be an odd bug with ft to m. The root of the problem might be this.

That's the current rnd/b code. My guess is that the complexity of the calculation is the problem ... who knows, though, I might be way off. I want to try some s in there instead but it's cascade protected at the moment. Here's the new code for

dec

00:33, 18 July 2008 (UTC)


 * Marking as ✅ since the code is now live, though I'm guess this didn't entirely solve the problem? — Huntster (t • @ • c) 06:18, 18 July 2008 (UTC)

It didn't solve it at all. J IM ptalk·cont 08:16, 18 July 2008 (UTC)

I think I might have got it right at last
This is going to take five steps.

Here is the new code for.
 * Step one

0

This should fix the template but it's only temporary. This will call rnd/a1 or rnd/a0 but they don't need protection since they are also temporary.

Here is the new code for rnd/a.
 * Step two

Here is the new new code for (it will only work after step two).
 * Step three

0

Remove protection from rnd/b: it's not going to be used by the template any longer (but I want to recycle it—i.e. preserve history ... just in case—as a subtemplate doc page).
 * Step four

Protect rnd/b1, rnd/b0 & rnd/b-1, the replacements of.
 * Step five

Thanks J IM ptalk·cont 09:22, 17 March 2009 (UTC)


 * ✅ I think I got it all (I skipped step 1, but it shouldn't matter). Let me know on my talk page if you need any emergency edits to fix any mistakes I might have made. --CapitalR (talk) 10:01, 17 March 2009 (UTC)

Thanks, I'll check whether things are okay. J IM ptalk·cont 10:04, 17 March 2009 (UTC)

Rnd/b1
This is the discussion/talk-page for: Template:Rnd/b1.

Created
The Template:Rnd/b1 was created by long-term user Jimp on 17 March 2009, to control rounding of large numbers using small short templates rather than a large template with many if-expressions. -Wikid77 (talk) 05:12, 21 November 2010 (UTC)

Changed to handle round -5
21-Nov-2010: The Template:Rnd/b1 was changed to overcome a rounding problem for cases such as "round-5" where the result was displayed in scientific notation, even though larger numbers were still displayed using end zeroes ("...000,000"). The fix required adding "round 0" after rounding by a negative amount:
 * round

So, when the rounding parameter {2} was negative ( <0 ), then the "round0" was also applied to change some scientific notation back into a number with zeroes. A case where this occurred was for 15,300,000 rounded by -5 to appear as "1.53E+7" in the text:
 * Currently: {#expr: 15300100 round-5} &rarr;
 * Adjusted: {#expr: 15300100 round-5 round0} &rarr;
 * Fixed Rnd: {Rnd|15300100 |-5} &rarr; 15300100
 * Currently: {#expr: 23400100 round-5} &rarr;
 * Adjusted: {#expr: 23400100 round-5 round0} &rarr;
 * Fixed Rnd: {Rnd|23400100 |-5} &rarr; 23400100

There might be other examples, but 15,300,000 as "1.53E+7" occurred in an article where larger numbers (from template Convert) had end-zeroes, causing an awkward style clash, where "1.53E+7" had appeared near another number. -Wikid77 (talk) 05:12, 21 November 2010 (UTC)

Changed to use #expr in #ifexpr
19-Feb-2011: The Template:Rnd/b1 was changed on 23 November 2010 to overcome another rounding problem where the #ifexpr parser function was incorrectly comparing expressions. See documentation at meta.wikimedia.org: m:Help:Round. The fix involved using #expr inside of #ifexpr to ensure the correct evaluation of the expressions inside the if-logic:

The inner expression divides by 1e5 (100,000) and multiplies by 1e5:
 * {&#123;#expr:(/1e5round0)e5}}

Because {&#123;#expr:100000 round -5}} gives:, where currently 100,000 - = , the use of dividing "/ 1e5 round0" plus "e5" gives:
 * {&#123;#expr:(/1e5round0)e5}} &rarr;
 * {&#123;#expr:(/1e5round0)e5}} &rarr;
 * {&#123;#expr:(/1e5round0)e5}} &rarr;
 * {&#123;#expr:(/1e5round0)e5}} &rarr;
 * {&#123;#ifexpr:(/1e5round0)e5 = 15300000 |same}} &rarr;

There are no examples yet to explain this situation causing a problem, to still require using #expr inside of #ifexpr, when rounding some particular numbers. -Wikid77 09:37, 19 February 2011 (UTC)