Version 5 of Euro converter

Updated 2002-01-03 13:45:50

Richard Suchenwirth - The following routine is not interesting for its algorithm. Two days after the introduction of Euro cash, this little Euro calculator rather commits the variety of soon extinct European currencies to history:

 proc Euro {direction currency amount} {
    set usage "usage: Euro {from|to} currency amount"
    switch -- $currency {
        ATS - �S   {set f 13.7603}
        BEF - bfr  {set f 40.3399}
        DEM - DM   {set f 1.95583}
        ESP - Ptas {set f 166.386}
        FIM - Fmk  {set f 5.94573}
        FRF - FF   {set f 5.55957}
        GRD - Dr   {set f 340.750}
        IEP        {set f 0.7787564}
        ITL - Lit  {set f 1936.27}
        LUF - lfr  {set f 40.3399}
        NLG - hfl - f {set f 2.20371}
        PTE - Esc  {set f 200.482}
        default    {error "bad currency $currency - $usage"}
    }
    switch -- $direction {
        from    {set f [expr {1./$f}]}
        to      {}
        default {error "bad direction $direction - $usage"}
    }
    format %.2f [expr {$amount*$f}]
 }

Arjen Markus As a Dutchman, I do like the use of the symbol "f", as this is the now all but extinct Dutch currency symbol :-) (To those with an interest in history: the "f" comes from "florin", a name derived from the wonderful city of Florence, Italy. In fact, an old name for the Dutch guilder is "florijn". Alas, those bygone days ...) RS Added "f" as alias for NLG. (I picked "f" as abbrev for "factor", but glad you like it ;-)


Unit converter - Arts and crafts of Tcl-Tk programming