Attention

This functionality is only available in the C++ toolkits. For other languages, we recommend using language-specific functionality instead.

OENumberToString

std::string OENumberToString(const bool &x)
std::string OENumberToString(const std::string &x)
std::string OENumberToString(int value, int base=10)
std::string OENumberToString(short value, int base=10)
std::string OENumberToString(OELongLong number, int base=10)
std::string OENumberToString(OEULongLong number, int base=10)
std::string OENumberToString(unsigned int value, int base=10)
std::string OENumberToString(unsigned short value, int base=10)
std::string OENumberToString(float number, char f= 'f', int prec=6)
std::string OENumberToString(double number, char f= 'f', int prec=12)
std::string OENumberToString(long double number, char f = 'f', int prec = 12)
bool OENumberToString(short value, std::string &numstr, int base=10)
bool OENumberToString(int value, std::string &numstr, int base=10)
bool OENumberToString(OELongLong value, std::string &numstr, int base=10)
bool OENumberToString(OEULongLong value, std::string &numstr, int base=10)
bool OENumberToString(unsigned int value, std::string &numstr, int base=10)
bool OENumberToString(unsigned short value, std::string &numstr, int base=10)
bool OENumberToString(double value, std::string &numstr, char format= 'f',
                      int precision=6)
bool OENumberToString(long double value, std::string &numstr,
                      char format = 'f', int precision=6)

Returns a string representation of the number value passed in. For integral types, the base should be between 2 and 36. For floating point types, the number of decimal places can be chosen with the prec argument. The format parameter, f should be one of the following: f, g, or e.

The overload that returns a boolean value can be used to detect whether the function fails. The overloads that return the string will return an empty string if the function fails.