Re: currency format for negative number
Daniel Dekany <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Thursday, May 21, 2009, 11:28:35 PM, Scott Purcell wrote:
> Hello,
>
> I have the following
> Adjustment Amount: ${adjustment.adjustmentAmount?string.currency!""}
>
> The adjustment.getAdjustmentAmount method returns a BigDecimal and
> all is good. Problem is the value for adjustment is -5.00.
> So when it prints to the email it prints ($5.00) which I thought
> was good, but the customer wants -$5.00.
>
> Can anyone assist with this?
I'm afraid it's out of our reach... we call the currency formatting of
the Java platform. However, personally I just wouldn't build on
that... call me paranoid, but who knows what will be the default
format in the next release. And displaying money is exactly something
that better not have bugs. Rather write a TemplateMethodEx (or a
#function maybe) so you can reliably control how are things displayed.
You see, ${my.currency(adjustment.adjustmentAmount)} or something...
> Thanks,
>
>
>
> CONFIDENTIALITY NOTICE
> This e-mail message and any attachments are only for the use of the
> intended recipient and may contain information that is privileged,
> confidential or exempt from disclosure under applicable law. If you
> are not the intended recipient, any disclosure, distribution or
> other use of this e-mail message or attachments is prohibited. If
> you have received this e-mail message in error, please delete and
> notify the sender immediately. Thank you.
--
Best regards,
Daniel Dekany
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com