🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #19007

Re: Fixing Decimal point??!?

#19007
From: Conrad Hoesle-Kienzlen
Date: Sun, 22 Mar 1998 00:00
18 lines
1189 bytes
Simon,
the simple answer is: multiply your number by 100, then round, then
multiply by 0.01 again.
...Conrad

Simon wrote:

> Hi everyone!
>     Can anyone tell me how do I round a  <double> value number with the
> number of  decimal points specified by myself . I only knows how to
> round a <double> value number to the nearest whole number with a
> specified <double> value using *rint(double)* method. For example, if I
> want to round a double value number of, say 12.583947384 to the nearest
> two decimal point number which is 12.58, what can I do? Urgent reply
> needed!! Many thanks in advance for anyone who is willing to help!!
>
> Simon.
Technical Details
Message-ID: <3515501D.32601A45@csi.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <35149F78.E29A4932@hotmail.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,d43ea8861e85a32e
X-Google-Attributes: gidf74b3,public
From: Conrad Hoesle-Kienzlen <Conrad_Hoesle@csi.com>
Subject: Re: Fixing Decimal point??!?
Date: 1998/03/22
Message-ID: <3515501D.32601A45@csi.com>
X-Deja-AN: 336570762
Content-Transfer-Encoding: 7bit
References: <35149F78.E29A4932@hotmail.com>
Content-Type: text/plain; charset=us-ascii
Organization: CHK IT-Consulting
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language