[program-java] Re: Java: Exponents

  • From: "Corbett, James" <James.Corbett@xxxxxxxxxxxxx>
  • To: "'program-java@xxxxxxxxxxxxx'" <program-java@xxxxxxxxxxxxx>
  • Date: Mon, 11 Jul 2011 10:06:59 -0400

Suzy:

I'm using Big Decimal as well.... it ended up being one of the custom classes 
we were using and eventually it got sorted out.

Yes I have been away more or less since the first of May.... I contracted food 
poisoning and it took two months for it to give up the ghost. A word to the 
wise, if food smells wierd, chances are it is, so don't eat it.

Jim

________________________________
From: program-java-bounce@xxxxxxxxxxxxx 
[mailto:program-java-bounce@xxxxxxxxxxxxx] On Behalf Of Stanzel, Susan - Kansas 
City, MO
Sent: July 11, 2011 09:56
To: program-java@xxxxxxxxxxxxx
Subject: [program-java] Re: Java: Exponents

Hi Jim C,
I'm sure you are aware of BigDecimal. That is what we use here at the United 
Staates Department of Agriculture when dealing with money. By the way, it seems 
to me you have been away for a while.
Susie Stanzel
From: program-java-bounce@xxxxxxxxxxxxx 
[mailto:program-java-bounce@xxxxxxxxxxxxx] On Behalf Of Willem
Sent: Tuesday, July 05, 2011 3:35 AM
To: program-java@xxxxxxxxxxxxx
Subject: [program-java] Re: Java: Exponents
Thanks for this.
On 7/4/2011 9:07 PM, Sina Bahram wrote:
This has the information you need. Just add 13 as the second parameter, as 
discussed.
http://www.javaprogrammingforums.com/java-programming-tutorials/297-how-format-double-value-2-decimal-places.html
take care,
Sina
From: 
program-java-bounce@xxxxxxxxxxxxx<mailto:program-java-bounce@xxxxxxxxxxxxx> 
[mailto:program-java-bounce@xxxxxxxxxxxxx] On Behalf Of Willem
Sent: Monday, July 04, 2011 1:34 PM
To: program-java@xxxxxxxxxxxxx<mailto:program-java@xxxxxxxxxxxxx>
Subject: [program-java] Re: Java: Exponents
Jim, as far as I know the conversion happens automatically if there will be a 
loss of precision. I couldn't find a method in the java api to convert back, 
but I'm sure you can write one with little effort or avoid this happening by 
using trunkation.
On 7/4/2011 5:42 PM, Corbett, James wrote:
Hi:
I have a data entry screen that accepts dollar values and the limit is set to 
13 digits that include the decimal and trailing cents to two places. However 
after formating the value on a lost focus event, particular entries are 
displayed as an exponent.
What's going on here and how should I address it?
Jim
James M. Corbett
Programmer / Analyst |
Canada Revenue Agency | Agence du revenue du Canada
875 Heron Rd.
Ottawa, On.
K1A0L5
James.Corbett@xxxxxxxxxxxxx<mailto:James.Corbett@xxxxxxxxxxxxx>
Telephone | Téléphone: (613) 941-1338
Facsimile | Télécopieur: (613) 941-2261
Government of Canada | Gouvernement du Canada
"Due to the highly confidential nature of my job, I'm not allowed to know what 
I'm doing."

Other related posts: