[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] currency-converter.egg
From: |
Jean-Philippe Théberge |
Subject: |
[Chicken-users] currency-converter.egg |
Date: |
Tue, 9 Oct 2007 11:16:58 -0400 (EDT) |
User-agent: |
SquirrelMail/1.4.4 |
In my process of learning "the chicken way" I have made an egg out of a
simple but useful currency converter.
[procedure] (currency-convert FROM TO AMOUNT #:table #:format?)
(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"
Although it is nothing as sophisticated as most of the eggs, I though
someone might be interested.
Rates are fetched from the European Central Bank
(http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html)
--
Jean-Philippe Théberge
Programmeur-Architecte
http://www.BuddyPilots.com
- [Chicken-users] currency-converter.egg,
Jean-Philippe Théberge <=