Solved

set BigDecimal 0.00

Posted on 2008-10-07
2
1,027 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Suggested Courses

738 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