Article View: borland.public.jbuilder.java.language
Article #8059How do I round a number?
From: Larry
Date: Mon, 23 Apr 2001 04:31
Date: Mon, 23 Apr 2001 04:31
6 lines
992 bytes
992 bytes
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:
<3ae3b004$1_2@dnews>Path:
arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!130.133.1.3!fu-berlin.de!news.boerde.de!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,250aeddcad7dba9c,start X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-04-22 21:41:15 PST From: "Larry" <LarryOberly@msn.com> Sender: "Larry" <LarryOberly@msn.com> Reply-To: "Larry" <LarryOberly@msn.com> Subject: How do I round a number? Newsgroups: borland.public.jbuilder.java.language X-User-Info: 63.42.91.139 63.42.91.139 NNTP-Posting-Host: 207.105.83.65 Message-ID: <3ae3b004$1_2@dnews> Date: 22 Apr 2001 21:31:00 -0700 X-Trace: dnews 988000260 207.105.83.65 (22 Apr 2001 21:31:00 -0700) Lines: 8 Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!130.133.1.3!fu-berlin.de!news.boerde.de!dnews