From: John English <je@bton.ac.uk>
Subject: Re: Conversion of numbers to strings & vice-versa
Date: Tue, 16 Jan 2001 10:17:58 +0000
Date: 2001-01-16T10:17:47+00:00 [thread overview]
Message-ID: <3A641FD6.C0179EDA@bton.ac.uk> (raw)
In-Reply-To: 937pip$9qq$1@news.vsnl.net.in
> 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
-----------------------------------------------------------------
parent reply other threads:[~2001-01-16 10:17 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <937pip$9qq$1@news.vsnl.net.in>]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox