Template talk:Hands/numdisp

This is the talk-page for: Template:Convert/numdisp.

Purpose
This template is used for numeric-display with the Template:Convert subtemplates, a tree of over 2,375 templates used to convert measurements, with numerous options. -Wikid77 (talk) 07:15, 8 October 2009 (UTC)

Add typical category to template
Please add the typical bottom category & "pp-template", like in the other 2,375 templates. WARNING: The &lt;noinclude> tag must be appended on the SAME LINE as the template coding; otherwise an annoying line-break will be generated into several thousand articles.

When creating a set of 2,376 templates, one always gets left out of the category. I hate it when that happens! -Wikid77 (talk) 07:15, 8 October 2009 (UTC)
 * ✅, although Special:PrefixIndex/Template:Convert/ would seem to work as well as the category. &mdash; Martin (MSGJ · talk) 11:50, 8 October 2009 (UTC)

Bypass Convert/numdisp/a to reduce 1 of 40 limit
Replace Template:Convert/numdisp from Convert/numdisp/sandbox, which drops usage of the nested subtemplate {Convert/numdisp/a} and links to {Documentation} to show the new /doc subpage (for interwiki links).
 * IMPACT: 326,000 pages will reformat. {Convert/numdisp} has been the top 86th template in Wikipedia usage, as used in almost all cases of {Convert}. The helper {Convert/numdisp/a} has been the top 85th used, and will be dropped from almost all pages, after update here. RISK: Low. {Convert/numdisp} is a simple template, despite all the HTML documentation comments, and merely branches to Convert/numdisp/fracparts, which mainly uses old template Convert/numdisp/frac1 to format postive fractions.

The new Template:Convert/numdisp/sandbox contains a rewrite, of the template (see test-cases below), to always bypass subtemplate {Convert/numdisp/a}, as 1 less level of nested subtemplates. During 2009-2010, templates would die if used inside infoboxes or docpages, where total if-else/template nesting exceeded 40 levels deep. The original design of {Convert/numdisp} always invoked {Convert/numdisp/a}, to avoid 4 duplicate expressions of extracting {#titleparts:xx|1|2}. However, the new version has refactored those expressions to avoid using 4 duplicate expressions when checking for fractions, at the top level. After the update, for most conversions, {Convert/numdisp} will no longer invoke any other subtemplates (in 99.7% of all conversions), where Convert/numdisp/fracparts will only be invoked for numbers like "46+2/8". Examples (expecting identical results):

For more details, read the documentation inside Template:Convert/numdisp/sandbox, which explains how the parameters work with new subtemplate Convert/numdisp/fracparts, to avoid the fraction subtemplates for 99.7% of conversions. -Wikid77 (talk) 19 Nov., revised 04:37, 20 November 2010 (UTC)
 * Done. As always, please revert and/or ping me if there is a problem. Thanks! Plastikspork ―Œ (talk)  03:13, 21 November 2010 (UTC)
 * Okay, now not done. I tried it, but it screwed up the table above.  I went back and forth a few times to try to find the problem, and then realized that the sandbox version was generating an extra newline somewhere.  We didn't see it before, since the sandbox template was at the end of the line.  Now, it's quite possible that this has no real impact to convert, but we should still try to fix it.  I swapped the order of the templates in your table to show the problem.  Thanks! Plastikspork ―Œ (talk)  03:27, 21 November 2010 (UTC)


 * OK, I removed the newline before final "}}" in Template:Convert/numdisp/fracparts, so the table displays correctly now. What a nightmare! No wonder so few people want to fix these templates. Try the sandbox again. -Wikid77 (talk) 03:48, 21 November 2010 (UTC)
 * Done. I will have a look at a sampling of the transclusions, but so far it looks fine. Plastikspork ―Œ (talk)  05:00, 21 November 2010 (UTC)


 * The history of /a is merged into the sandbox. J IM ptalk·cont 01:47, 28 June 2011 (UTC)

Update Convert/numdisp for minus sign
12-Feb-2011: Replace Template:Convert/numdisp from Convert/numdisp/sandbox, which now puts a Unicode minus sign "-" for negative numbers. The results have been tested to NOT put spurious newlines in amounts (see test-cases below).
 * IMPACT: Over 320,000 pages will reformat. {Convert/numdisp} has been the top 86th template in Wikipedia usage, as used in almost all cases of {Convert}. RISK: Low. The change has been tested, and {Convert/numdisp} is a simple template, despite all the HTML documentation comments, and merely branches to Convert/numdisp/fracparts, which mainly uses old template Convert/numdisp/frac1 to format postive fractions.

The Template:Convert/numdisp/sandbox contains the update, of the template (see test-cases below). Examples (expecting identical results, after update, with full minus signs):

For more details, read the documentation inside Template:Convert/numdisp/sandbox, which explains how the parameters work. -Wikid77 (talk) 01:04, 12 February 2011 (UTC)
 * Done. As always, let me know (and revert) if there is a problem. Thanks! Plastikspork ―Œ (talk) 01:30, 12 February 2011 (UTC)

Fix Convert/numdisp for trailing zeroes
16-Feb-2011: Replace Template:Convert/numdisp from Convert/numdisp/sandbox, to re-add trailing zeroes when &minus sign is used. This a better emergency fix, to fix the prior fix. More results have been tested, to NOT drop end-zeroes, and NOT put spurious newlines (see test-cases below).
 * IMPACT: Over 339,000 pages will reformat. {Convert/numdisp} has been the top 90th template in Wikipedia usage, as used in almost all cases of {Convert}. RISK: Low. The change has been tested with a far wider range of numbers, to help detect any other problems when formatting unusual numbers.

The Template:Convert/numdisp/sandbox contains the update, of the template (see test-cases below). Examples (expecting identical results, after update, with full &minus signs, except -0.0):

For more details, read the documentation inside Template:Convert/numdisp/sandbox, which explains how the parameters work. -Wikid77 16:36, 17 February 2011 (UTC)
 * Done. Thanks! Plastikspork ―Œ (talk)  19:59, 17 February 2011 (UTC)

E notation
Wouldn't it be nice if we could get this to convert e-notation into words and/or standard scientific notation? ∃ a request @ talk pertaining to this. Maybe something like "e"s in "×10"s and strings of zeros into "~illions". J IM ptalk·cont 06:15, 17 May 2011 (UTC)