Template talk:ToUSDvalues

From Wikipedia, the free encyclopedia

Hello. This is just a helper-template for the {{toUSD}} template, which you can find here. Bladestorm 22:36, 14 February 2007 (UTC)

Contents

[edit] Sources

Maybe put in the template common sources for the exchange rate info. I used x-rates.com but I'm sure there is something better/more readable. Cmsjustin 21:15, 15 February 2007 (UTC)

You know what? That's a dandy idea!
I use this. Just click the "Generate Currency Table!" button, and find the values under the "USD per Unit" column.
(It's fine to just list it here, right? Or should it be added on the template page, nowiki'd, also?) Bladestorm 23:19, 15 February 2007 (UTC)
That table works great. I wonder if someone could write a bot to do this automatically somehow. I don't know how often it would be updated, you know, by a human. Cmsjustin 21:22, 16 February 2007 (UTC)
Direct link for future reference http://www.xe.com/ict/?historical=false&basecur=USD&sort_by=codecmsJustin (talk|contribs) 23:37, 9 March 2007 (UTC)
Free RSS feed for future reference. 1/x=usable number. http://www.currencysource.com/RSS/USD.xmlcmsJustin (talk|contribs) 20:05, 12 March 2007 (UTC)

[edit] Adding other currencies

By the way, if anyone should wish to add more currencies, other than those currently in the table, you're, of course, more than welcome to do so. I would only request (and that's all it is, a request):

  1. You use the Currency Code for the currency you're using. (eg. CAD for canadian dollar, not CDN)
  2. You leave USD, EUR, and GBP at the top of the list. (I'm canadian myself, but even I know those are the three most significant currencies for anything the template is likely to be used for)
  3. After those three currencies, that everything else be sorted alphabetically by currency code.
  4. That no currency is listed twice. (eg. No listing CAD and CDN) This shouldn't be a problem if only proper currency codes are used.

Again, it's only a request. It's in the general domain now, so it isn't my template. Bladestorm 23:24, 15 February 2007 (UTC)

My most recent edit keeps them in alphabetical order by country code. If I make a bot I will put them at the top. —cmsJustin (talk|contribs) 00:39, 10 March 2007 (UTC)

[edit] Semi-automated process for updating values

  1. Go to http://www.xe.com/ict/?historical=false&basecur=USD&sort_by=code and copy only the rows of the table with information.
  2. Paste into Microsoft Excel as HTML, remove all formatting from the cells and turn off word wrap
  3. Insert some columns and create some placeholders, maybe call them COL1, COL3, COL5, COL7, so now a row should look like this:

    COL1 AED COL3 0.272338571 COL5 United Arab Emirates Dirhams COL7

  4. Save this as a tab-delimited text file and open it up in a text editor with a replace function (I used notepad)
  5. Replace COL1 with |, COL3 with =, COL5 with <! --, and COL7 with -->, so now your lines will look like this:

    | AED=0.272338571 <! -- United Arab Emirates Dirhams -->

    You may need to adjust your replaces with spaces to match what is in the template now. I used tabs before the "<! --". Speaking of that, there is no space between the "!" and the "-", I just put it there because it will comment it out if I don't.

I'm trying to automate this process but it is proving difficult. I'm trying to find a free source for the values with a data feed and make a bot to update them daily. —cmsJustin (talk|contribs) 00:37, 10 March 2007 (UTC)

I noticed Excel rounded some numbers, I'll be careful to set the number format next time. —cmsJustin (talk|contribs) 02:51, 10 March 2007 (UTC)
Wow. Somebody's been busy, eh? :)
BTW, if you want to be able to write markup tags without having them actually treated as html tags (eg. to show commenting without it really being turned into commenting), then you can put it between 'nowiki' tags. See: <!--Note that this isn't actually commented.--> (just 'edit' this comment to see what I mean by 'nowiki' tags) Bladestorm 17:45, 12 March 2007 (UTC)
Ah ok, I wasn't sure because even though the nowiki skips wiki stuff, it's still html niameen? Good to know —cmsJustin (talk|contribs) 23:39, 12 March 2007 (UTC)

[edit] Serbian Dinar

I noticed this was added recently, but I don't see it any of the data feeds listed above. Is it possible it is listed under a different name? It seems to track Pakistan Rupees maybe? —cmsJustin (talk|contribs) 12:49, 26 March 2007 (UTC)

I moved it to the bottom if the list and used Google to update the info (Google RSD in USD) —cmsJustin (talk|contribs) 22:12, 28 March 2007 (UTC)

[edit] Automated script

I'm testing a new script that uses Google's currency conversion to obtain values. Right now about 80% of the older currency codes we were using are supported. Let me know if anyone notices any important ones missing (meaning a page that uses this is no longer functioning due to a missing value). The script link is on my userpage. —cmsJustin (talk|contribs) 00:52, 29 March 2007 (UTC)

[edit] Descriptions

Hexagon, diff I noticed this change you made. I am currently running a script that automatically updates the values, and it uses a list of predetermined currencies and descriptions. That file is kept here: User:Cmsjustin/ISO4217.txt. I updated it to show Polish Zloty. Feel free to make any updates to this file and I will check for changes before each run. Currently it uses Google for conversions, so if you decide to add a new currency make sure Google will accept it first. Also check out User:Cmsjustin for the entire script and User talk:Cmsjustin if you want to comment on it. Thanks! —cmsJustin (talk|contribs) 12:02, 6 April 2007 (UTC)

Ooh ooh ooh! I wanna comment! I wanna comment! *ahem*
Ya done good. :D
(Wait, do I have to go to your talk page to say that? Because I'm pretty lazy) Bladestorm 13:43, 6 April 2007 (UTC)
Whoopsie, I should start reading template desc's, huh? :) In any case, this template should not be kept dependant on an external file, especially one in the userspace. It could be moved to /codes or something like that. The script you run should also be written here, probably in the noinclude section. +Hexagon1 (t) 09:24, 8 April 2007 (UTC)