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.6 required=5.0 tests=BAYES_40,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,41f4f79bf9ae837a X-Google-Attributes: gid103376,public From: "Marin D. Condic" Subject: Re: Conversions Date: 2000/03/16 Message-ID: <38D0F5CC.95F0F9B7@quadruscorp.com>#1/1 X-Deja-AN: 598231888 Content-Transfer-Encoding: 7bit References: <38D0A673.EED850FD@student.ecu.edu.au> Organization: Quadrus Corporation X-Sender: "Marin D. Condic" (Unverified) X-Server-Date: 16 Mar 2000 11:55:42 GMT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-03-16T11:55:42+00:00 List-Id: Karlene Johnson wrote: > > I am trying to convert an Float number to an Integer number, after a > calculation with 2 Float numbers. Any suggesions on how to convert?? X : Float := 1.234 ; Y : Integer := 0 ; .... Y := Integer (X) ; -- Y should now contain the value "1" There are a number of ways of handling truncation & rounding, but this is the plain vanilla way to do it. The type name acts as a function to perform the conversion. However, it only works with "compatible" types. (You can't for example, convert a String to a Float this way.) MDC -- ============================================================= Marin David Condic - Quadrus Corporation - 1.800.555.3393 1015-116 Atlantic Boulevard, Atlantic Beach, FL 32233 http://www.quadruscorp.com/ m c o n d i c @ q u a d r u s c o r p . c o m ***PLEASE REMOVE THE "-NOSPAM" PART OF MY RETURN ADDRESS*** Visit my web site at: http://www.mcondic.com/ "Because that's where they keep the money." -- Willie Sutton when asked why he robbed banks. =============================================================