http://freemarker.org/docs/ref_builtins_number.html----- Original Message ----
From: Sumit Porwal <
[hidden email]>
To:
[hidden email]
Sent: Wednesday, December 19, 2007 9:17:45 AM
Subject: Facing problem with double value
Hi All,
I am using " ${shoppingCart.getTotalSalesTax()?if_exists} " in ftl
and
it shows the output like "4" but my requirement is to display it like
"4.00"
how can I implement it? I tried to use BigDecimal object like "
<#assign xyz
=
"java.math.BigDecimal"?new(shoppingCart.getTotalSalesTax()?if_exists)> "
so that I can use the " setScale(decimals, rounding) " method but I got
the
error given bellow:
Error rendering included template at location
[component://xyz/webapp/xyz/order/checkout/OrderReview.ftl]:
freemarker.template.TemplateException: Class java.math.BigDecimal does
not
implement freemarker.template.TemplateModel
Exception: freemarker.template.TemplateException
Message: Class java.math.BigDecimal does not implement
freemarker.template.TemplateModel
Thanks and Regards,
Sumit