Article View: borland.public.jbuilder.java.language
Article #7443Re: Newbie Truncate question
From: Rich Wilkman
Date: Tue, 19 Jun 2001 16:39
Date: Tue, 19 Jun 2001 16:39
23 lines
1441 bytes
1441 bytes
Phil: I guess it depends on what you mean by truncate. Let's say you have: 3.1415 What do you want it to become? 3? 3.14? 3.142? The first is just shoving it into an int. The second is lopping off at 2 decimal places and the 3rd is lopping off at 3 decimal places and rounding. I ask because I don't want to make assumptions about the type of the var you have named integer in your example <g>. -Rich Phil Barber wrote: > > How do I truncate a double > (in delphi: integer := trunc(double);) > in Java??? > > thanks > Phil.
Technical Details
Message-ID:
<3B2F803C.BC0A19E2@formlessvoid.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3b2f52a0_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,568d12e56ba0c6bd X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-06-19 09:42:17 PST Message-ID: <3B2F803C.BC0A19E2@formlessvoid.com> Date: Tue, 19 Jun 2001 09:39:24 -0700 From: Rich Wilkman <richw@formlessvoid.com> X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language Subject: Re: Newbie Truncate question References: <3b2f52a0_1@dnews> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 208.236.69.60 X-Trace: dnews 992968760 208.236.69.60 (19 Jun 2001 09:39:20 -0700) Lines: 23 Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews