A representation of the Spanner NUMERIC type: an exact numeric value with 29 decimal digits of integer precision (kIntPrec) and 9 decimal digits of fractional precision (kFracPrec).
More...
|
| Numeric () |
| A zero value. More...
|
|
|
| Numeric (Numeric &&)=default |
| Regular value type, supporting copy, assign, move. More...
|
|
Numeric & | operator= (Numeric &&)=default |
| Regular value type, supporting copy, assign, move. More...
|
|
| Numeric (Numeric const &)=default |
| Regular value type, supporting copy, assign, move. More...
|
|
Numeric & | operator= (Numeric const &)=default |
| Regular value type, supporting copy, assign, move. More...
|
|
|
std::string const & | ToString () const & |
| Conversion to a decimal-string representation of the Numeric in one of the following forms: More...
|
|
std::string && | ToString () && |
| Conversion to a decimal-string representation of the Numeric in one of the following forms: More...
|
|
A representation of the Spanner NUMERIC type: an exact numeric value with 29 decimal digits of integer precision (kIntPrec) and 9 decimal digits of fractional precision (kFracPrec).
So, the range of a Numeric
is -99999999999999999999999999999.999999999 to 99999999999999999999999999999.999999999.
A Numeric
can be constructed from, and converted to a std::string
, a double
, or any integral type. See the MakeNumeric()
factory functions, the ToString()
member function, and the ToDouble()
/ToInteger()
free functions.
Numeric
values can be copied/assigned/moved, compared for equality, and streamed.
- Example
assert(spanner::ToInteger<int>(n).value() == 1234);
A representation of the Spanner NUMERIC type: an exact numeric value with 29 decimal digits of intege...
std::string const & ToString() const &
Conversion to a decimal-string representation of the Numeric in one of the following forms:
StatusOr< Numeric > MakeNumeric(std::string s)
Construction from a string, in decimal fixed- or floating-point formats.
Definition at line 85 of file numeric.h.