LTL
2.0.x
|
This class returns a number in the requested type. More...
Static Public Member Functions | |
static string | toString (const double xd, const int width=DBL_DIG+7, const int precision=DBL_DIG, const char format= 'd') |
static string | toString (const float xd, const int width=FLT_DIG+7, const int precision=FLT_DIG, const char format= 'd') |
static string | toString (const long xd, const int width=((sizeof(long)*8)/3)+1) |
static string | toString (const int xd, const int width=((sizeof(int)*8)/3)+1) |
static string | toMinSecString (const double xd, const int precision=0) |
Return xd in dd:mm:ss[.sss] format. More... | |
static int | toInt (const string &xs) |
Convert xs to integer number. More... | |
static long | toLong (const string &xs) |
Convert xs to long integer number. More... | |
static float | toFloat (const string &xs) |
Convert xs to float number. More... | |
static double | toDouble (string xs) |
Convert xs to double number. More... | |
Static Protected Member Functions | |
template<class T > | |
static string | floatToString (const T xd, const int width, const int precision, const char format) |
template<class T > | |
static string | intToString (const T xd, const int width) |
static void | changeFormat (ostringstream &s, const char format) |
Static Protected Attributes | |
static const string | factory_text |
static const string | error_text |
This class returns a number in the requested type.
In case of string output this is a right adjusted string of selected length and (if possible) precision. The string is filled with leading blanks to match width.
|
inlinestaticprotected |
Convert float/double to string
format,: | char to select the floatfield format flag
|
References error_text, and factory_text.
|
inlinestaticprotected |
References error_text, and factory_text.
|
staticprotected |
set the floatfield format flag
s,: | ostringstream where to write |
format,: | char to select the floatfield format flag
|
|
static |
Convert number to string
format,: | (for double and float only) char to select the floatfield format flag
|
|
static |
|
static |
|
static |
|
static |
Return xd in dd:mm:ss[.sss] format.
Precision gives No second decimals.
|
inlinestatic |
Convert xs to integer number.
|
inlinestatic |
Convert xs to long integer number.
|
inlinestatic |
Convert xs to float number.
dd:mm:ss[.sss] strings are automatically recognized.
References toDouble().
|
static |
Convert xs to double number.
dd:mm:ss[.sss] strings are automatically recognized.
Referenced by toFloat().
|
staticprotected |
Referenced by floatToString(), and intToString().
|
staticprotected |
Referenced by floatToString(), and intToString().