Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

set BigDecimal 0.00

Posted on 2008-10-07
2
Medium Priority
?
1,091 Views
Last Modified: 2012-06-22
hi guys

BigDecimal.ZERO  sets a 0
so i can do
object.setAmount(BigDecimal.ZERO);

If i want to set something like 0.00 , any idea how that should be done ?

thanks
J
0
Comment
Question by:jaggernat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 14

Accepted Solution

by:
agriesser earned 1200 total points
ID: 22663138
The ZERO property always returns the value 0 with a scale of 0, so no decimal points here.
I don't know if there's a better solution to this, but I'd use that approach:
BigDecimal bdzero = new BigDecimal("0.00");
object.setAmount(bdzero);

Open in new window

0
 
LVL 10

Author Closing Comment

by:jaggernat
ID: 31503987
thx
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question