Re:

From: Mario Kadastik <mario.kadastik_at_cern.ch>
Date: Thu, 08 Sep 2005 12:58:38 +0300


chameli ghosh wrote:

>
> Dear Sir/Madam,
> I am chameli Ghosh , Student of MCA(Final Year). My
> Project is continue at VECC ,this is temperature monitoring system by
> using Root & C++ . I have two problem :
> 1. How to display the floating number on the graphical window,
> which is taken from any file ?
> 2. How to Conver the string to float & float to string in
> root?(That is not accept the c++ function).
>
> Please explain that with an example.
>

2a: string to float:

root [0] strtod("1.2345","\0")
(const double)1.23449999999999993e+00

2b: float to string:

root [0] char str[20];
root [1] sprintf(str,"%.4f",1.2345)
(const int)6
root [2] str
(char* 0xad406e8)"1.2345"
root [3] sprintf(str,"%.6f",1.2345)
(const int)8
root [4] str
(char* 0xad406e8)"1.234500"

hope it helps,

Mario Received on Thu Sep 08 2005 - 12:05:13 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:12 MET