Template talk:±

(Redirected from Template talk:±/testcases)
Latest comment: 3 years ago by Lithopsian in topic Proposal to merge with {{val}}

template

edit

I suggest people refrain from using this template for now because it doesn't show right at least on the Internet Explorer and Opera.--JyriL talk 19:11, 14 May 2006 (UTC)Reply

The problem in IE is the absolute position of the second span, if you use ..."position: relative; left: -4.0ex; top: 0.5ex"... it renders the same in IE and Firefox, but there is a gap where the span would have been. JohnCastle 20:17, 7 November 2006 (UTC)Reply
On IE, the "position:absolute" is correctly interpreted as meaning an absolute position from the start of the document. A span element, only modified by a "position:relative " CSS attribute, is not enough to define a new origin for absolute positions.
The alternative on IE is to use the ruby notation (but unfortunaltely it does not work in Mozilla), or the "display:inline-block" CSS attribute, which also works fine in IE, but still not in Mozilla/Firefox where it is displayed as a block and not inlined (meaning that there's a line-break...)
The only safe solution for such model is the "display:inline-block", where the content has its layout formatted as rows (we can even include any number of line breaks in IE), but externally, the block is inlined in the rest of the page, and can even be positioned relatively (notably to adjust the vertical position of the block : in IE we can even inline a complete table, exactly like we do for objects, images, or simple characters; we can also inline IFRAME's despite their content is also a block, including its possible scrollbars).
As long as Mozilla/Firefox does not support "display:inline-block" (or at least ruby) there's absolutely no way to make such template work as intended. For now, all we can do is to use <math> 86.221.26.222 20:59, 3 December 2006 (UTC)Reply

one parameter/zero parameters

edit

Shouldn't this also work with zero parameters, when the two sides are equal... say resulting in 555{{+-}}3 == "555 ± 3" ... or one parameter 555{{+-|3}} == "555 ± 3" . 76.66.203.138 (talk) 10:33, 12 November 2010 (UTC)Reply

That would be a very different but useful function. For that it just as simple to use the ± character, it might be worth documenting this.--Salix (talk): 12:58, 12 November 2010 (UTC)Reply
Since it's difficult to actually type this character, it would be nice to have in this template. I have made a scratch sample of the new and improved version. See Template:±/sandbox and Template:±/testcases for the test examples. 76.66.203.138 (talk) 10:14, 14 November 2010 (UTC)Reply
Looks good. I've moved both into the template namespace rather than template talk. I've also simplified the template somewhat removing the named parameters, I don't think there is a pressing need to uses these. I'm not sure whether it would be better to have spaces after the ±. To me 3.2  ± 0.4 looks better than 3.2  ±0.4 or 3.2±0.4 --Salix (talk): 16:07, 14 November 2010 (UTC)Reply
Well, spacing is up to the user... if they use spaces or not is up to them. I just put that up in the testcases to make sure I didn't leave extra spaces or carriage returns lying around in the code. The named parameters came about because of standard programming practice. As did the user feedback error return lines. And the code spacing (I coded a MediaWiki ParserFunction template once, without any carriage returns and minimal spacing before I understood that MediaWiki would actually some accept standard coding practices... and I could simulate others with HTML comment tags... that was incredibly hard to read) 76.66.203.138 (talk) 18:42, 14 November 2010 (UTC)Reply
Shall we convert this to the sandbox version? 76.66.203.138 (talk) 08:02, 19 November 2010 (UTC)Reply

Edit protected

edit

Please implement the sandboxed version. I just tried to use this template, and needed something similar to the sandbox version rather than the current version. 65.93.12.101 (talk) 08:35, 2 April 2011 (UTC)Reply

  Done  Hazard-SJ  ±  03:25, 3 April 2011 (UTC)Reply

Proposal to merge with {{val}}

edit

This template is a stripped version of {{val}}, we should not duplicate our efforts in two templates but rather merge them. Given that the name "±" does not cover the extra features "val" supports, I think it's best to discontinue a separate "±" by turning it into a "wrapper" for val and/or replacing all current instances of it's use with val or both. I'd personally prefer discontinuing ± altogether, but I assume people will want to continue to use it for it's brevity? Please comment.     SkyLined (talk) 22:12, 17 July 2011 (UTC)Reply

I also noticed that {{±}} does not provide proper spacing compared to {{val}}'s <span style="margin-left:0.3em;margin-right:0.15em">±</span>, compare:
1±2 using ±
1±2 using val
Since no-one has commented on my suggestion, I will start the merger as soon as I find some time. SkyLined (talk) 14:10, 18 February 2015 (UTC)Reply
Agreed it should be a wrapper rather than an outright merge. This would fix the rendering difference between the two templates. Lithopsian (talk) 15:08, 26 October 2020 (UTC)Reply
I've edited this template to match the behaviour of {{val}} as closely as possible since it doesn't currently support a syntax to reproduce the behaviour of this template. Lithopsian (talk) 20:30, 10 December 2020 (UTC)Reply