ITK
6.0.0
Insight Toolkit
|
#include <itkNumberToString.h>
Convert floating and fixed point numbers to strings.
This class uses the double-conversion library to floating point and fixed point numbers to ASCII versions that are represented without numerical precision errors.
Typical use: #include "itkNumberToString.h" NumberToString<float> convert; float a = 1.0f/3.0f; std::cout << convert(a) << std::endl;
The specialization NumberToString<>
allows conversion from any type of number:
NumberToString<> convert; float a = 1.0f/3.0f; auto b = std::numeric_limits<int>::max(); std::cout << convert(a) << convert(b) << std::endl;
Definition at line 49 of file itkNumberToString.h.
Public Member Functions | |
ITKCommon_EXPORT std::string | operator() (double val) const |
ITKCommon_EXPORT std::string | operator() (float val) const |
std::string | operator() (TValue val) const |
ITKCommon_EXPORT std::string itk::NumberToString< double >::operator() | ( | double | val | ) | const |
ITKCommon_EXPORT std::string itk::NumberToString< float >::operator() | ( | float | val | ) | const |
std::string itk::NumberToString< TValue >::operator() | ( | TValue | val | ) | const |