Solved

set BigDecimal 0.00

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

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…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
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.

622 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