The Artima Developer Community
Sponsored Link

Java Answers Forum
Precision problem with float variable

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
jinaraj

Posts: 8
Nickname: bullet
Registered: Feb, 2002

Precision problem with float variable Posted: Apr 7, 2002 1:10 AM
Reply to this message Reply
Advertisement
Hi,
I have class with an amount variable whose type is float. If a value like 999999.99 is set to this variable, when I try to display this in JSP, the precision is lost. It displays 1000000. But my requirement is to print 999999.99. Is there any to solve this problem? The constraint to this prioblem is I can't change the data type of this variable. (Actually this class is generated through Castor. The xsd type is float. I am not supposed to change the XSD). Please advise.

Topic: JTextPane problem Previous Topic   Next Topic Topic: Need min w/o it including the 0 I use to quit

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use