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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,28b49968fc94ca2f X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,44904c91a60a8df9,start X-Google-Attributes: gid103376,public From: nasser@apldbio.com (Nasser Abbasi) Subject: Re: how to convert float number into char string? Date: 1996/06/15 Message-ID: #1/1 X-Deja-AN: 160378006 sender: news@biosys.apldbio.COM references: <4pic7t$73s@hobbes.cc.uga.edu> <31BDD755.53E4@thirdsigma.mv.com> to: alcilcius@thirdsigma.mv.com (Al Cilcius) followup-to: comp.lang.c++ organization: Applied BioSystems newsgroups: comp.lang.c++,comp.lang.ada Date: 1996-06-15T00:00:00+00:00 List-Id: Since this was shown in C and C++, we might as well show it in Ada for completion sake :) -- -- move float number to string... Ada95 version ... Nasser Abbasi -- with Ada.Text_Io; use Ada.Text_Io; with Ada.Strings.Fixed; use Ada.Strings.fixed; procedure My_Float is type Float_Type is digits 10; -- lets have a 10 digits float number Fs: String(1..80); F: Float_Type; begin F:=2.57876453; -- give it some value Put_Line("float is " & Float_Type'Image(F)); -- print it -- print how many digits our floating variable has Put_Line("f has this many digits=" & Integer'Image(Float_Type'Digits)); Move(Float_Type'Image(F),Fs); -- move the float to string Put_line(Fs); -- and print the string to make sure it is there end My_Float; -- Nasser Abbasi. C/C++/Ada Solaris. GeneAssist - A client/server application for Nucleic acid and protein sequence search and analysis. PE-Applied BioSystem division. email: nasser@apldbio.com MSEE, MSCS, MSCE, FM (and Karpov is my chess hero! ..).