Changes between Version 8 and Version 9 of EasyGuiCurrencyConverter


Ignore:
Timestamp:
Oct 19, 2007, 4:44:46 AM (13 years ago)
Author:
alms
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • EasyGuiCurrencyConverter

    v8 v9  
    3030    (setf (action convert-button)
    3131          #'(lambda ()
    32               (setf (entry-text currency-form 2)
    33                     (prin1-to-string
    34                      (* (read-from-string (entry-text currency-form 1))
    35                         (read-from-string (entry-text currency-form 0)))))))
     32              (let ((exchange-rate (entry-text currency-form 0))
     33                    (amount (entry-text currency-form 1)))
     34                (unless (or (zerop (length exchange-rate))
     35                            (zerop (length amount)))
     36                  (setf (entry-text currency-form 2)
     37                        (prin1-to-string
     38                         (* (read-from-string exchange-rate)
     39                            (read-from-string amount))))))))
    3640    (add-entries currency-form
    3741                 "Exchange Rate per $1:" "Dollars to Convert:"