Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== Outdated egg! This is an egg for CHICKEN 3, the unsupported old release. You're almost certainly looking for [[/eggref/4/currency-converter|the CHICKEN 4 version of this egg]], if it exists. If it does not exist, there may be equivalent functionality provided by another egg; have a look at the [[https://wiki.call-cc.org/chicken-projects/egg-index-4.html|egg index]]. Otherwise, please consider porting this egg to the current version of CHICKEN. [[toc:]] [[tags: eggs money xml ssax xpath]] == Currency-converter Perform currency convertion, using data from the XML feeds of the [[http://www.ecb.int/|European Central Bank.]] == Author [[mailto:jptheberge@buddypilots.com|Jean-Philippe Theberge]] == Version 1.0.0 (initial release) == Requires * ssax * format * http == Usage (require-extension currency-converter) == Documentation '''Procedure:''' (currency-convert FROM TO AMOUNT [#:table TABLE] [#:format? FORMAT?]) FROM and TO are symbols, AMOUNT is either a string or a number. TABLE is an alternate conversion to use, an alist of (SYMBOL . EURO-VALUE) FORMAT?, if #f, will not format the result as money (and thus return a string) '''Variable:''' currency-converter-table When #f (the default) the XML is retrieved and parsed from the bank at every call to currenncy-convert. When set, it's value is used as the conversion table. '''Procedure:''' (currency-converter-table-initialize!) Retrieve and parse current values from the bank and set currency-converter-table. == Available currencies <table> <tr><td>'''AUD'''</td><td>Australian dollar</td></tr> <tr><td>'''BGN'''</td><td>Bulgarian lev</td></tr> <tr><td>'''CAD'''</td><td>Canadian dollar</td></tr> <tr><td>'''CHF'''</td><td>Swiss franc</td></tr> <tr><td>'''CNY'''</td><td>Chinese yuan renminbi</td></tr> <tr><td>'''CYP'''</td><td>Cyprus pound</td></tr> <tr><td>'''CZK'''</td><td>Czech koruna</td></tr> <tr><td>'''DKK'''</td><td>Danish krone</td></tr> <tr><td>'''EEK'''</td><td>Estonian kroon</td></tr> <tr><td>'''GBP'''</td><td>Pound sterling</td></tr> <tr><td>'''HKD'''</td><td>Hong Kong dollar</td></tr> <tr><td>'''HRK'''</td><td>Croatian kuna</td></tr> <tr><td>'''HUF'''</td><td>Hungarian forint</td></tr> <tr><td>'''IDR'''</td><td>Indonesian rupiah</td></tr> <tr><td>'''ISK'''</td><td>Icelandic krona</td></tr> <tr><td>'''JPY'''</td><td>Japanese yen</td></tr> <tr><td>'''KRW'''</td><td>South Korean won</td></tr> <tr><td>'''LTL'''</td><td>Lithuanian litas</td></tr> <tr><td>'''LVL'''</td><td>Latvian lats</td></tr> <tr><td>'''MTL'''</td><td>Maltese lira</td></tr> <tr><td>'''MYR'''</td><td>Malaysian ringgit</td></tr> <tr><td>'''NOK'''</td><td>Norwegian krone</td></tr> <tr><td>'''NZD'''</td><td>New Zealand dollar</td></tr> <tr><td>'''PHP'''</td><td>Philippine peso</td></tr> <tr><td>'''PLN'''</td><td>Polish zloty</td></tr> <tr><td>'''RON'''</td><td>New Romanian leu</td></tr> <tr><td>'''RUB'''</td><td>Russian rouble</td></tr> <tr><td>'''SEK'''</td><td>Swedish krona</td></tr> <tr><td>'''SGD'''</td><td>Singapore dollar</td></tr> <tr><td>'''SKK'''</td><td>Slovak koruna</td></tr> <tr><td>'''THB'''</td><td>Thai baht</td></tr> <tr><td>'''TRY'''</td><td>New Turkish lira</td></tr> <tr><td>'''USD'''</td><td>US dollar</td></tr> <tr><td>'''ZAR'''</td><td>South African rand</td></tr> </table> == Examples (currency-convert 'USD 'EUR 45.34) => "32.03" (currency-convert 'USD 'EUR 45.34 #:format? #f) => 32.3003490774382 (currency-convert 'USD 'EUR 45.34 #:table '((EUR . 1)(USD . 34))) => "1.33" == Licence Copyright 2007 Jean-Philippe Theberge This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. A full copy of the GPL license can be found at http://www.gnu.org/licenses/.</td>
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you subtract 4 from 21?