Article View: borland.public.jbuilder.java.language
Article #19410Re: Rounding Double Values
From: Rich Wilkman
Date: Thu, 05 Feb 1998 00:00
Date: Thu, 05 Feb 1998 00:00
35 lines
1544 bytes
1544 bytes
Matthew: Do you want rounding or do you want truncation? Also, if this is for currency and you need accuarcy (i.e., you want to avoid the rounding errors inherent to floating point values), consider the old COBOL trick of using integers and a fixed style instead. -Rich Matthew Allen wrote: > > this may be a stupid question, but is there an easy way to round/limit > the number of decimal points when using double/float values? > > i tried to use BigDecimal Class but was unsuccessful > > thanx in advance > > Matthew Allen -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Rich Wilkman Senior Quality Assurance Engineer Borland JBuilder Team If you see something that looks like an opinion up there, it's mine and mine alone. Mail sent to me from the newsgroups won't bounce but will be ignored. If I have time, I'll respond, but you have a better chance if you confine your posts to the newsgroups =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Technical Details
Message-ID:
<34D9FF47.FAF71856@corp.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<34D900BA.3C5103F6@gpo.online.swin.edu.au>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,6560186bc34ead19 X-Google-Attributes: gidf74b3,public From: Rich Wilkman <rwilkman@corp.borland.com> Subject: Re: Rounding Double Values Date: 1998/02/05 Message-ID: <34D9FF47.FAF71856@corp.borland.com> X-Deja-AN: 322366931 Content-Transfer-Encoding: 7bit References: <34D900BA.3C5103F6@gpo.online.swin.edu.au> Content-Type: text/plain; charset=us-ascii Organization: None Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language