From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, LOTS_OF_MONEY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b5ada130a6506d9a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-21 00:46:26 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!psinet-eu-nl!psiuk-p4!uknet!psiuk-p3!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: rounding floating point numbers Date: Wed, 20 Feb 2002 17:53:29 -0500 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: References: NNTP-Posting-Host: dhcp-200-133.miami.pace.co.uk X-Trace: nh.pace.co.uk 1014245610 4088 136.170.200.133 (20 Feb 2002 22:53:30 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 20 Feb 2002 22:53:30 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:20201 Date: 2002-02-20T22:53:30+00:00 List-Id: Multiply by one hundred & convert to integer. Convert the integer back to float and divide by one hundred. Or you can invent a fixed point type with appropriate precision and do some type conversions. Depends a lot on what sort of features you need the numbers to have.... You can also find lots of help doing things like rounding, truncation, floor, ceiling, etc., by looking in the "Annex K: Language-Defined Attributes" in the ARM. MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "Fraz" wrote in message news:yfVc8.96077$as2.15328940@news6-win.server.ntlworld.com... > Hi > > How do i round a floating number to 2 decimal places? I know u can use > Fore, Aft, Exp in the PUT command, but i want to pass the number as > a paramater to something else, but i only want it to 2 decimal places? is > there a way to store the number like this in a variable? > > Fraz > >