commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fachhoch <fachh...@gmail.com>
Subject Re: utils to display currency for any bigdecimal
Date Wed, 15 Jul 2009 18:54:38 GMT

I  asking If there is any simpler way to do this right now I doing it 
NumberFormat.getCurrencyInstance().format(ObjectUtils.defaultIfNull(stgFinding.getFindingAmt(),
new BigDecimal(0)))
NumberFormat.getCurrencyInstance().format   throws exception  if the object
passed to it is null ,I am aksing if there is anything available with
commons utils which takes care of this internally ? 

Ted Dunning wrote:
> 
> I find manuals very handy for questions like this:
> 
> http://java.sun.com/j2se/1.5.0/docs/api/java/io/PrintWriter.html#printf(java.lang.String,%20java.lang.Object..
> .)
> 
> http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#format(java.lang.String,%20java.lang.Object..
> .)
> 
> 
> 
> On Wed, Jul 15, 2009 at 10:28 AM, tubin gen <fachhoch@gmail.com> wrote:
> 
>> Is there any utils to display a bigdecimal with $56,98
>>  for example is there any utils which takes a bigdecimal , does not throw
>> exception if it is null and if not then formats   to comma seperated
>> number
>> with $ symbol before ?
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/utils-to-display-currency-for-any-bigdecimal-tp24502491p24503798.html
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message