Solved

set BigDecimal 0.00

Posted on 2008-10-07
2
991 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now