Provides support for manipulating NUMERIC values. More...

#include <SQLAPI.h>

Public Member Functions

 SANumeric ()
 Default constructor, initializes to zero. More...
 
 SANumeric (double dVal)
 Initializes from double. More...
 
SANumericoperator= (double)
 Reinitializes from double. More...
 
 operator double () const
 Converts to double. More...
 
 SANumeric (sa_int64_t iVal)
 Initializes from 64-bit integer. More...
 
 SANumeric (sa_uint64_t iVal)
 Initializes from unsigned 64-bit integer. More...
 
SANumericoperator= (sa_int64_t)
 Reinitializes from 64-bit integer. More...
 
SANumericoperator= (sa_uint64_t)
 Reinitializes from unsigned 64-bit integer. More...
 
 operator sa_int64_t () const
 Converts to 64-bit integer. More...
 
 operator sa_uint64_t () const
 Converts to unsigned 64-bit integer. More...
 
SANumericoperator= (const SAChar *sVal)
 Reinitializes from string. More...
 
 operator SAString () const
 Converts to string. More...
 

Data Fields

unsigned char precision
 The maximum number of digits in base 10. More...
 
unsigned char scale
 The number of digits to the right of the decimal point. More...
 
unsigned char sign
 The sign: 1 for positive numbers, 0 for negative numbers. More...
 
unsigned char val [SA_NUMERIC_MANTISSA_SIZE]
 A number stored as SA_NUMERIC_MANTISSA_SIZE-byte scaled integer, with the least-significant byte on the left.
 

Detailed Description

Provides support for manipulating NUMERIC values.

Constructor & Destructor Documentation

◆ SANumeric() [1/4]

SANumeric::SANumeric ( )

Default constructor, initializes to zero.

◆ SANumeric() [2/4]

SANumeric::SANumeric ( double  dVal)

Initializes from double.

◆ SANumeric() [3/4]

SANumeric::SANumeric ( sa_int64_t  iVal)

Initializes from 64-bit integer.

◆ SANumeric() [4/4]

SANumeric::SANumeric ( sa_uint64_t  iVal)

Initializes from unsigned 64-bit integer.

Member Function Documentation

◆ operator=() [1/4]

SANumeric & SANumeric::operator= ( double  dVal)

Reinitializes from double.

◆ operator double()

SANumeric::operator double ( ) const

Converts to double.

◆ operator=() [2/4]

SANumeric & SANumeric::operator= ( sa_int64_t  iVal)

Reinitializes from 64-bit integer.

◆ operator=() [3/4]

SANumeric & SANumeric::operator= ( sa_uint64_t  iVal)

Reinitializes from unsigned 64-bit integer.

◆ operator sa_int64_t()

SANumeric::operator sa_int64_t ( ) const

Converts to 64-bit integer.

◆ operator sa_uint64_t()

SANumeric::operator sa_uint64_t ( ) const

Converts to unsigned 64-bit integer.

◆ operator=() [4/4]

SANumeric & SANumeric::operator= ( const SAChar sVal)

Reinitializes from string.

◆ operator SAString()

SANumeric::operator SAString ( ) const

Converts to string.

Field Documentation

◆ precision

unsigned char SANumeric::precision

The maximum number of digits in base 10.

◆ scale

unsigned char SANumeric::scale

The number of digits to the right of the decimal point.

◆ sign

unsigned char SANumeric::sign

The sign: 1 for positive numbers, 0 for negative numbers.

If you haven't found the answer to your questions or have some problems on using the Library, please, send e-mail to howto@sqlapi.com
SQLAPI++ 5.0.1, Mon Oct 21 2019