Template:US$ is permanently protected from editing because it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use ((edit template-protected)) to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases.
This is the talk page for discussing improvements to the US$ template.
This template is within the scope of WikiProject United States, a collaborative effort to improve the coverage of topics relating to the United States of America on Wikipedia. If you would like to participate, please visit the project page, where you can join the ongoing discussions.
This template is within the scope of WikiProject Numismatics, a collaborative effort to improve the coverage of numismatics and currencies on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.NumismaticsWikipedia:WikiProject NumismaticsTemplate:WikiProject Numismaticsnumismatic articles
I have changed the template to be in accordance with the Manual of Style. I think this template maybe should be deleted. It requires more typing than not using the template and it is highly doubtful that the standard will be changed from the English standard usage there now. - Centrx 19:33, 19 May 2006 (UTC)[reply]
Actually, to link the US$, it requires less typing. - Centrx 19:36, 19 May 2006 (UTC)[reply]
Before it can be deleted, the pages that use it have to be changed. There are only about 20 of them. Can you do this? - Samsara (talk • contribs) 18:13, 24 May 2006 (UTC)[reply]
I am content, possibly, to let that template remain, because it is somewhat useful, in that ((USD|100)) is shorter to type than [[United States dollar|US$]]100, though maybe this just clutters the namespace for something that won't be used much or might be vandalized? Still, any article that uses it should use the "subst" part so that the text of the template is put right in the article, rather than referenced, which referencing apparently taxes the server. I am going to do that now. - Centrx 03:58, 26 May 2006 (UTC)[reply]
On the question of substitution, I note that substituting ((US$|100)) would add only a small amount of code to an article: [[United States dollar|US$]]100.
On the question of utility, it seems to me that it would be just as easy to type [[US$]]100 instead of ((US$|100)). The only difference is that US$ is a redirect, whereas this template contains a piped link to United States dollar. It seems to me that the template is useful only if it is substituted, since ((US$|100)) requires fewer keystrokes than [[United States dollar|US$]]100—17 versus 31. Whether that usefulness is enough to justify keeping the template is another question...
I noticed that these questions were discussed in the section #Template does not agree with MOS and that the original documentation for the template required substitution, but that requirement was removed in this edit. If there is a reason to keep the template, then I propose that we alter the documentation to indicate that it should be substituted; and if there is conensus for that, then I can substitute the ~250 current transclusions using AWB. –Black Falcon(talk) 19:00, 25 January 2010 (UTC)[reply]
I like this template because:
editors don't have to remember what the MOS says (US$, USD, usd, us$, US $, etc),
we don't have to update every page when the MOS changes (rare),
it opens up the possibility to display the US amount and a conversion to a registered reader's home currency - eg US$100 (AU$150),
it opens up the possibility to link to a page that queries for a non US currency and do a conversion (similar to what ISBN1-4133-0454-0 does for books).
Items 2-4 would require transclusion instead of substitution. Stepho (talk) 09:14, 5 February 2010 (UTC)[reply]
I have reservations about the idea of displaying currency conversions within articles, mostly because it is immensely difficult under such an approach to account for inflation and changes in exchange rates over time. A conversion of US$100 (2005) to € at the 2005 exchange rate could be useful (although, exchange rates fluctuate even during the course of a single year), but a conversion of US$100 (2005) to € at the current exchange rate would be misleading.
Still, the possibility of adding functionality, which I admit I had not considered, is enough to substantially weaken my belief in my original position (that the template is "useful only if it is substituted"), and I thank you for your thoughtful reply. –Black Falcon(talk) 20:30, 9 February 2010 (UTC)[reply]
((editprotected))
Could we get a year or date paramater? The dollar has incurred notable inflation over time. $10 in 1990 would get you $16.21 worth today, and $10 today would be worth $5.83 in 1990. See inflation calculator.Smallman12q (talk) 22:44, 14 April 2010 (UTC)[reply]
Code removed to improve readability. — Martin (MSGJ · talk)
Examples:
((USD|100|2009))
US$100 (equivalent to $142.02 in 2023)
((USD|100|1950))
US$100 (equivalent to $1,266 in 2023)
((USD|100|2000))
US$100 (equivalent to $176.93 in 2023)
((USD|100))
US$100
If I understand the code correctly, we could use something like 'In 1950 it cost ((USD|100|1950))' to show 'In 1950 it cost US$100 (about $903 in 2010)'. As long as the year parameter is optional (it appears to be), then it sounds fine to me. Stepho (talk) 14:24, 12 May 2010 (UTC)[reply]
Is this code ready to go? Has it been tested? I notice that a "required subtemplate" is still a redlink ... Some clarification please. — Martin (MSGJ · talk) 21:10, 12 May 2010 (UTC)[reply]
Its been tested in my sandbox (examples here). It's fully ready to go... I'll create the subpage right now. --Yarnalgotalk to me 22:36, 12 May 2010 (UTC)[reply]
Could you stick it in Template:US$/sandbox, removing all the links to your userspace? — Martin (MSGJ · talk) 11:07, 13 May 2010 (UTC)[reply]
Looks good! Added — Martin (MSGJ · talk) 20:54, 16 May 2010 (UTC)[reply]
Just one problem - the template does not fail gracefully when present or future years are entered. Could you do something about that? — Martin (MSGJ · talk) 20:56, 16 May 2010 (UTC)[reply]
I updated the sandbox to simply not display the parenthetical if the year is outside the 1913–2009 range (see the testcases). I could also make it display a simple error message (something like Please specify a year from 1913–2009). --Yarnalgotalk to me 21:49, 16 May 2010 (UTC)[reply]
I think this template should use the calculation (or at least the data) from ((Inflation)), so that it doesn't have to be maintained in both places. Amalthea 22:07, 16 May 2010 (UTC)[reply]
Wow... I wish I'd seen that template earlier haha. I did a quick update so this template is now using that template's data but I'll update the sandbox so that it will just use that template completely. --Yarnalgotalk to me 00:08, 17 May 2010 (UTC)[reply]
((editprotected))
Requesting a sync with the sandbox. I've improved the rounding for inflation: It will automatically round to the nearest dollar (instead of cent) if it is over $1000. Also, a new round parameter can be used to control the rounding to any amount. (see testcases for examples). --Yarnalgotalk to me 23:20, 27 May 2010 (UTC)[reply]
According to WP:NBSP, "US$5.3 million" should be coded as "US$5.3 million" or its ((Nowrap)) equivalent, so it won't word wrap to the next line between "5.3" and "million". That can be accomplished by coding ((US$|5.3 million)). But perhaps your template should make the nbsp automatic, because most editors won't remember it otherwise – and also because the above workaround looks as if it won't work, even though it does. Art LaPella (talk) 04:39, 22 July 2010 (UTC)[reply]
Trivially fixed by wrapping the template in a nowrap span. I also removed the non-breaking space before the optional value for equivalence, as WP:NBSP says nothing about it being undesirable to wrap before parentheses. Can you test the code in the sandbox to see if this resolves the problem for you? Chris Cunningham (user:thumperward: not at work) - talk 08:56, 22 July 2010 (UTC)[reply]
Yes. I've never done such a test before, but it works for this and this (it didn't work for ((US$/sandbox|42 million|1916|round=0)), but the non-sandbox version doesn't handle that case either). I unmaximized that page and stretched the window in and out, and the nbsp's worked as intended. So thank you. Art LaPella (talk) 21:23, 22 July 2010 (UTC)[reply]
apparently the latest changes made leaves an unwanted trailing space that interferes with punctuation. example: US$4 million♦. --emerson7 15:28, 1 September 2010 (UTC)[reply]
((editprotect))
As per WP:Linking, the instances where United States dollar ought to be linked are few and far between. However, this template's use proliferates this common term. I ask that the wikilink be removed. Thanks, --Ohconfucius¡digame! 03:33, 8 October 2010 (UTC)[reply]
Ah, saw this in OC's contribs, and am alarmed that this is still linked, contrary to the style guides. In fact, my other concern is that the style guides say US$ are the default currency: the "US" should generally not be used unless there is reason to disambiguate it with other dollar currencies (say, in an article on Fiji, or Australia—and then, only once in the context where it's subsequently clear). Is this template encouraging editors into the opposite? If so, we should change the style guides. Tony(talk) 03:37, 8 October 2010 (UTC)[reply]
I read it as needing the currencies to be disambiguated whenever it is not clear whcih currency is in use. As an Australian, I find it confusing when an article says $. Was it written by an American who habitually uses $ without thinking (ie US$)? Was it written by a Australian doing the same thing (AU$)? Or was it written by an Australian trying to be global (ie US$)? Similarly for HK$, TW$, CA$ and probably others I'm not yet aware of.
Also, before this template started, many editors were trying to make it explicit by doing $45.00, US$45.00, us$45.00, usd45.00, USD45.00, USD$45.00, $45.00(US) and many other variations - quite often in the same article. If we dropped the US ouput of this template then many editors will start putting in their own US specifiers again and will be back in the mess that we started in.
Howvere, I do agree that a link for every use is over the top. It is hard to make it automatically link only on the first invocation in an article, so perhaps we can turn the link off by default and have a named parameter to explicitly re-enable the link when the editor wants it. Stepho (talk) 08:39, 8 October 2010 (UTC)[reply]
Done. I've delinked it by default, but it may be linked by using |link=yes — Martin (MSGJ · talk) 12:02, 8 October 2010 (UTC)[reply]
Is is possible to offer the option to handle price ranges, such as how ((convert)) handles ranges? – VisionHolder « talk » 08:37, 9 January 2011 (UTC)[reply]
I think that should be possible and would be a good feature. I don't have time to do it myself in the next month though. Stepho (talk) 23:33, 12 January 2011 (UTC)[reply]
Currently, the template displays large currency values in their entirety or in scientific notation. Since large currency values are discussed in millions, billions, and trillions of dollars, there should be an option to display large currency values with the corresponding abbreviations (e.g. $1M for $1,000,000 $10bn for $10,000,000,000). If you know how to code this in the template, please do so. –Temporal User (Talk) 01:52, 27 August 2011 (UTC)[reply]
It's a good idea but a bit beyond my current skills. Perhaps one of the other editors can have a crack at it. Stepho talk 08:45, 27 August 2011 (UTC)[reply]
+1 on this, it would be a nice feature to have. Something like |scaled= and T, B or M (trillion, billion or million) to force a specific scale (even if such a scale results in something like 0.75M or 1,500M) or a simple 0 (disabled) or 1 (enabled) to have the template automagically decide based on the input value to use million (for values > 1 million but < 1 billion), billion (for values > 1 billion but < 1 trillion) or trillion (for values > 1 trillion). —Locke Cole • t • c 17:09, 18 January 2024 (UTC)[reply]
After reading through the talk page I'm not going to request any edits anyway, but I wanted to ask: why is this template is protected at all? According to the transclusion count tool it's only used on ~1500 pages (currently). — V = IR(Talk • Contribs) 17:38, 31 March 2012 (UTC)[reply]
Only 1500? Sounds like a lot of article to screw up, either deliberately or by accident. Stepho talk 10:53, 1 April 2012 (UTC)[reply]
It looks like you moved Template:USD to Template:US$ a while back, which is fine except that it seems to make you the "administrator of record" in the protection log (I guess). It looks like someone named User:Nick originally protected the USD template as a high-risk template, but the problem is that the US$ template is clearly not highly visible (although I could see it becoming so in the future. I brought the subject up on the talk page a couple of days ago, but the only response received was a question about what an HRT was (essentially). So, would you mind removeing (or reducing, at least) the protection from Template:US$? User:Ohms lawTalkContribs) 15:24, 1 April 2012 (UTC)[reply]
Alright well... I assume that you're saying "ask User:Nick", so I dropped a note on his talk page. He hasn't edited since early December though (outside of one edit on March 1), so we'll see what happens. I guess that I'll just drop a note on RFPP if nothing happens in the next few days. — V = IR(Talk • Contribs) 01:32, 2 April 2012 (UTC)[reply]
This needs a rewrite to reduce template expansion depth[edit]
The inflation/year feature uses up 33 of the 40 levels of "expansion depth" allowed by MediaWiki software. This means if something like ((US$|1|2001)) is used in a template that itself has 7 levels of "expansion depth" surrounding the use of this template, the page will have problems.
Note that ((Inflation)) uses 21 of these 33 levels.
I've updated the documentation.
The best solution would be to turn this or ((inflation)) or both into a module. Other options include re-coding it to have less expansion depth. davidwr/(talk)/(contribs) 22:45, 13 February 2020 (UTC)[reply]
Since ((Inflation)) is the more complex template and uses up more levels, I would choose that one to make into a module. Stepho talk 13:24, 14 February 2020 (UTC)[reply]
Could we add a parameter that'd allow input here to be formatted using ((Format price))? ((u|Sdkb))talk 19:38, 21 September 2020 (UTC)[reply]
If this is done, care must be taken not to increase the "expansion depth" until the issues from February are eliminated, or it could cause problems on some pages that use the template. Whoever does this please please please test it out in a sandbox and compare the "template expansion depth" to make sure it doesn't "cost" a layer under any circumstances. In the alternative, address the issues raised in February first. davidwr/(talk)/(contribs) 20:08, 21 September 2020 (UTC)[reply]
That would be great, because I constantly refer to how I optimized it in the lead of Great Flood of 1951. — Smuckola(talk) 08:49, 7 August 2022 (UTC)[reply]
This template always uses the US inflation index. For some things one has to use the US-GDP index. Trigenibinion (talk) 01:25, 21 December 2020 (UTC)[reply]
On Nintendo_64_Game_Pak#Manufacturing_cost, please let me know if you think that my inflation calculation prose is ok, because inflation is important to a section about comparing many intricate costs at a certain historical mark. I mean, with a list of numerous prices like that, I just abbreviated it as direct parentheses without the repeated "equivalent to". But I reiterated the full statement with each paragraph. Kind of like how I do "long=yes" at the first instance in a whole article. The inflation calculator template policy is very against original research in numbers but it doesn't give examples on how to do this. Shouldn't there be an argument added to Template:US$ to eliminate "equivalent to" for this case? Or to change the accessory text, like we have in Template:As of so it doesn't only output "as of". — Smuckola(talk) 08:47, 7 August 2022 (UTC)[reply]
Template-protected edit request on 27 December 2022[edit]
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request.
Should the minus sign be placed before (-$1) or after ($-1) the dollar sign? 79.185.136.221 (talk) 21:23, 29 December 2022 (UTC)[reply]
WP doesn't seem to have an explicit policy on this but various style guides recommend, for US dollars, that the negative sign goes first. Other currencies may differ. See https://learn.microsoft.com/en-us/globalization/locale/currency-formatting . ((currency)) puts the dollar sign first - although this may have been arbitrary choice. You should try to avoid negative amounts if possible - eg "the company made a loss of $1,000,000" instead of "the yearly profits were -$1,000,000". Stepho talk 00:32, 30 December 2022 (UTC)[reply]
I've noticed that a lot of articles that use this template with more than just numbers are part of this category. Ex: 200 Pounds Beauty, which has
((USD|42,013,016))
Is there any way to prevent this from being labeled as a non-numeric formatnum argument without messing up how it looks? All I can think of is replacing the aforementioned text with
((USD|42)),013,016
but it might look awkward in source mode. - OpalYosutebito (talk) 01:47, 23 March 2024 (UTC)[reply]