Fct_Float_2_Text

 

Convert a floating point value to a text string.

 

 

Syntax

 

char * Fct_Float_2_Text

          double val,

          char *str=NULL

) ;

 

 

Parameters

 

val

Original floating point value.

 

str

Optional pointer to a text buffer that will contain the results.  If NULL (the default) the result text string will be a static string locate inside the function.

 

 

Return value

 

This function return a pointer to a text string containing a text representation of the floating point value "val"

 

 

Remarks

 

If you do not specify a target string and you call the function twice, the second call to the function will overwrite the value returned by the first call since they will share the same static variable.

 

 

Requirements

 

Header:

          sliceO_include.hpp

 

 

Library:

          sliceO_Structures.lib

 

 

 

Example

 

...

 

int          ROIs::Text( Texts *text )

{

char text_1[20], text_2[20] ;

 

          // --- Local tool: one image only ---

          if ( ! (this->m_mode & MEASURE_FLAG_GLOBAL) ) {

 

                     // --- compute ROI parameters ---

                     this->Compute( this->frame ) ;

 

                    ...

                    Fct_Float_2_Text( this->val_min, text_1 ) ;

                    Fct_Float_2_Text( this->val_max, text_2 ) ;

                    text->Write( "min/max:  \xF1%s/%s", text_1, text_2 ) ;

                    ...

          }

 

          return( 1 ) ;

}

 

...

 

 

See also