Representing money

Andy Jones <[email protected]>
Newsgroups gmane.comp.lang.ruby.general
Message-ID <[email protected]>
Re: "Behaviour of round changed?".
Pardon my curiosity -- what do you use to represent money in your code?  It seems to me that the choices are between:

1)      BigDecimal

2)      Rational

3)      A custom class
To my way of thinking, if you are multi-currency, you almost certainly want #3; but otherwise it's down to personal preference?  I plumped for BigDecimal, but I wonder if it would have been easier on me if I had gone for Rational instead?




Click here to view Company Information and Confidentiality Notice.<http://www.jameshall.co.uk/index.php/small-print/email-disclaimer>

Please note that we have updated our privacy policy in line with new data protection regulations. Please refer to our website to view the ways in which we handle your data.


Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.