Kailash Sethy <[EMAIL PROTECTED]> wrote:
> Hi Mike,
> If I use the $number.format('currency',$myNumber) for a -ve number,
> the output becomes ($number)
>
> $myNumber -> -13.55
> $number.format('currency',$myNumber) -> ( $13.55)
>
> How to show with -ve sign without parenthesis bracket after
> formatting?
Your best bet is to ask on the [email protected] mailing
list, to which I've cc'd this message.
Internally, NumberTool just references NumberFormat:
http://java.sun.com/j2se/1.4.2/docs/api/java/text/NumberFormat.html
You can also "cheat" and treat the result of
"$number.getNumberFormat('number', $number.getLocale()))" as a
DecimalFormat, although this may fail for releases other than Velocity 1.3.1
and Velocity Tools 1.1.
#macro (formattedCpac $value $valueIfEmpty)
#set ($cpacFormatter = $number.getNumberFormat('number',
$number.getLocale()))##
${cpacFormatter.setMinimumFractionDigits(5)}##
${cpacFormatter.setMaximumFractionDigits(5)}##
#if($value)${cpacFormatter.format($value)}#else${valueIfEmpty}#end#end
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]