Solved

set BigDecimal 0.00

Posted on 2008-10-07
2
999 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
2 Comments
 
LVL 14

Accepted Solution

by:
agriesser earned 300 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

770 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