From: "David C. Hoos" <david.c.hoos.sr@ada95.com>
Subject: Re: float2string
Date: Wed, 6 Mar 2002 09:51:09 -0600
Date: 2002-03-06T09:51:09-06:00 [thread overview]
Message-ID: <mailman.1015429502.5276.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: a65c2a$ifr$1@polaris.cc.upv.es
----- Original Message -----
From: "Pedro Jose Garcia Gil" <pggil@isa.upv.es>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: Wednesday, March 06, 2002 9:19 AM
Subject: float2string
>
> Hello.
> I want to send a float by the serial port.
>
> In C, I use the function "buffer=fcvt(source,7,&decimal,&signo);". I have
> tried to import this function from C to Ada95, but I have had problems
with
> the char pointer (char *buffer). I don't know how to manage with the
> equivalent in Ada to a char pointer.
>
> Can I convert a float to a string in Ada?. How?.
>
You can use the attribute function Float'Image (<float-expression>) to
obtain a
scientific notation string.
If you want a particular format, you can use the Put procedure described in
the LRM A.10.9 (30)
> Thank you very much.
>
> Pedro.
>
>
>
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
>
prev parent reply other threads:[~2002-03-06 15:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-06 15:19 float2string Pedro Jose Garcia Gil
2002-03-06 15:51 ` David C. Hoos [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox