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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a3a2f453eeaefb5e,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-16 02:42:09 PST Path: supernews.google.com!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!newsfeed.cwix.com!newsfeed.icl.net!newspeer.clara.net!news.clara.net!news-hub.cableinet.net!news2.vas-net.net!server2.netnews.ja.net!newshost.central.susx.ac.uk!news.bton.ac.uk!not-for-mail From: John English Newsgroups: comp.lang.ada Subject: Re: Conversion of numbers to strings & vice-versa Date: Tue, 16 Jan 2001 10:17:58 +0000 Organization: University of Brighton Message-ID: <3A641FD6.C0179EDA@bton.ac.uk> References: <937pip$9qq$1@news.vsnl.net.in> NNTP-Posting-Host: straumli.it.bton.ac.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: saturn.bton.ac.uk 979640267 16687 193.62.183.204 (16 Jan 2001 10:17:47 GMT) X-Complaints-To: news@bton.ac.uk NNTP-Posting-Date: 16 Jan 2001 10:17:47 GMT X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: en Xref: supernews.google.com comp.lang.ada:4048 Date: 2001-01-16T10:17:47+00:00 List-Id: > Are there any functions in the Ada library that convert integers > to strings and vice versa -- something like the C atoi (), atof () > etc. There are attributes for this stuff: X'Image(Y) converts Y (of type X) to a string, and X'Value(Y) converts Y (a string) to type X. Some examples: Integer'Image(123) = " 123" Float'Value("123_456.789") = 1.23456789E+5 Boolean'Value("true") = True Boolean'Image(False) = "FALSE" ----------------------------------------------------------------- John English | mailto:je@brighton.ac.uk Senior Lecturer | http://www.it.bton.ac.uk/staff/je Dept. of Computing | ** NON-PROFIT CD FOR CS STUDENTS ** University of Brighton | -- see http://burks.bton.ac.uk -----------------------------------------------------------------