From: Sebastian Hungerecker Date: 2009-06-22T08:55:06+09:00 Subject: Re: Product Class #2 Am Montag 22 Juni 2009 01:43:35 schrieb Zorigami: > was wondering if anyone had any ideas on how I could make the following > method "return "$#{@price}0" if "@price" only has one 0 after the ".", and > just "return "$#{@price}" if it has two? "$%.2f" % @price Note though that for accuracy reason it's best to store currency as an int of cents, not a float of dollars so then it would look like this: "$%d.%02d" % @price.divmod(100) HTH, Sebastian