> From: Thien-Thi Nguyen <[email protected]> > > Note, however, that usually it is better (less fiddly) > to represent monetary values as integers.
Yes, always represent money as an integer number of cents and put in a decimal point when you print. That is, "$16.98" is produced by something like (money->string 1698). This is true for ALL languages, although it is especially easy to do in Scheme with its large integer arithmetic. If you will need large integers in some other language, take the time to implement them. You do NOT want to lose precision by using floating point. "Fiddly" is the least of your worries; you might go to jail for round-off error. You do not want to finish this conversation: CFO: What happened to the $12,345.67? You: Well, you see sir, IEEE floating point... -- Keith
