Thanks Derek!

I hadn't noticed the "bigDecimal" member of scala.BigDecimal.  (I'm still so used to looking for explicit getter methods!)

I now have my code do this:

    Text(String.format("$%,.2f", item.amount.bigDecimal))

instead of my old

    Text(item.amount.toString)

--Andrew

Derek Chen-Becker wrote:
The BigDecimal value of a MappedDecimal field is Scala's BigDecimal, which itself wraps the Java BigDecimal. At the very least you can use java.text.DecimalFormat to format the underlying java.math.BigDecimal. Let me know if you have any further questions.

Derek

On Mon, May 18, 2009 at 6:19 PM, Andrew Scherpbier <and...@scherpbier.org> wrote:

How does one format a BigDecimal?  I don't want to .toString()...

I'm using a MappedDecimal and I would to format its value.  I've tried
using java.lang.String.format() but it doesn't know what a
scala.BigDecimal is...  Help!

BTW, I'm using 1.1-SNAPSHOT

--Andrew








--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to