Article View: borland.public.jbuilder.java.language
Article #8061Re: How do I round a number?
From: Calvin R. Smith
Date: Mon, 23 Apr 2001 05:34
Date: Mon, 23 Apr 2001 05:34
12 lines
1324 bytes
1324 bytes
how about doing the division to get one then doing it again to grab the remainder and increment the answer by one if needed. "Larry" <LarryOberly@msn.com> wrote in message news:3ae3b004$1_2@dnews... > > I would like two divide two numbers and then round up the > fractional part. For example if I divide two ints, 12/7 the > answer is 1.71 but Java will discard the .71 for an answer of > 1 what I would really like to happen is to have it round up to > 2. How do I do this? Thanks > >
Technical Details
Message-ID:
<3ae3bf3c$1_2@dnews>Path:
arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-02!supernews.com!bignews.mediaways.net!news.uni-paderborn.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3ae3b004$1_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,250aeddcad7dba9c X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-04-22 22:42:58 PST From: "Calvin R. Smith" <calvinrsmith@hotmail.com> Newsgroups: borland.public.jbuilder.java.language References: <3ae3b004$1_2@dnews> Subject: Re: How do I round a number? Date: Sun, 22 Apr 2001 23:34:37 -0600 Lines: 14 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 64.81.97.250 Message-ID: <3ae3bf3c$1_2@dnews> X-Trace: dnews 988004156 64.81.97.250 (22 Apr 2001 22:35:56 -0700) Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-02!supernews.com!bignews.mediaways.net!news.uni-paderborn.de!newsfeed01.sul.t-online.de!t-online.de!dnews