DB Link
API Reference Guide
Product Documentation:

Visualization DB Link
Documentation Home
List of all members | Public Member Functions
IldNumeric Class Reference

This class allows you to display numbers in an internationalized context. More...

#include <ildblink/ilinum.h>

Inheritance diagram for IldNumeric:
IlNumeric

Public Member Functions

 IldNumeric (IlEnvironment *env)
 Initializes a new IldNumeric instance. More...
 
 IldNumeric (IlEnvironment *env, const char *value)
 Build an initialized IldNumeric instance. More...
 
 IldNumeric (IlEnvironment *env, double value)
 Initializes a new IldNumeric instance. More...
 
 IldNumeric (IlEnvironment *env, long value)
 Initializes a new IldNumeric instance. More...
 
const IlEnvironmentgetEnvironment () const
 Gets the object reference environment. More...
 
IlBoolean isBad () const
 Indicates if the last function called for this object failed. More...
 
IlBoolean set (const char *value)
 Assigns a new value for the instance. More...
 
IlBoolean set (double value)
 Assigns a new value for the instance. More...
 
IlBoolean set (long value)
 Assigns a new value for the instance. More...
 
const IlEnvironmentsetEnvironment (IlEnvironment *env)
 Sets the object reference environment. More...
 
- Public Member Functions inherited from IlNumeric
 IlNumeric ()
 Builds an IlNumeric instance. More...
 
 IlNumeric (const char *value)
 Builds an IlNumeric instance and initializes it. More...
 
 IlNumeric (long value)
 Builds an IlNumeric instance an initializes it. More...
 
IlNumeric abs () const
 
void get (char *buffer, IlInt len) const
 
IlShort getPrecision () const
 
IlShort getScale () const
 
IlBoolean isInteger () const
 
IlBoolean isNegative () const
 
IlBoolean isReal () const
 
void negate ()
 
 operator double () const
 
 operator long () const
 
IlNumeric operator* (const IlNumeric &)
 
IlNumeric operator+ (const IlNumeric &)
 
IlNumeric operator+ (long)
 
IlNumeric operator- (const IlNumeric &)
 
IlBoolean operator< (const IlNumeric &n) const
 
IlBoolean operator<= (const IlNumeric &n) const
 
IlBoolean operator== (const IlNumeric &n) const
 
IlBoolean operator> (const IlNumeric &n) const
 
IlBoolean operator>= (const IlNumeric &n) const
 
IlBoolean set (const char *value)
 
IlBoolean set (long value)
 
IlNumericsetScale (IlShort scale)
 

Detailed Description

This class allows you to display numbers in an internationalized context.

Library: dbkernel

This class is a container to store numbers (integers, reals, and big numerics) and to display them based on the active locale.

It will use the attached environment description to find the current locale and use it to format the numbers accordingly.

Note
While this class supports big numerics (bignums), due to the derivation from the previous IlNumeric class, the formating will not work as the underlying ICU libraries do not support the bignums.

Constructor & Destructor Documentation

◆ IldNumeric() [1/4]

IldNumeric::IldNumeric ( IlEnvironment env)

Initializes a new IldNumeric instance.

Parameters
envThe environment of reference.

This constructor creates and returns an instance of IldNumeric and initializes it to the value 0 (zero).

Note
If the value of the argument env is null, no error will be raised but one may not expect the formating to work according to any locale except the default one.

◆ IldNumeric() [2/4]

IldNumeric::IldNumeric ( IlEnvironment env,
const char *  value 
)

Build an initialized IldNumeric instance.

Parameters
envA const reference to the environment.
valueA const reference to a char*.

This constructor creates and returns an instance of IldNumeric and initializes it with the contents of value. This value must conform to the format: [-|+]{digit}*[.[{digit}*]] | [-|+]{digit}+[.[{digit}*]][{E|e} [-|+]{digit}+] The input string size is limited by the maximum length IL_MAX_NUM_LEN.

◆ IldNumeric() [3/4]

IldNumeric::IldNumeric ( IlEnvironment env,
long  value 
)

Initializes a new IldNumeric instance.

Parameters
envA const reference to the environment.
valueThe initial value as a long.

◆ IldNumeric() [4/4]

IldNumeric::IldNumeric ( IlEnvironment env,
double  value 
)

Initializes a new IldNumeric instance.

Parameters
envA const reference to the environment.
valueThe initial value as a double.

Member Function Documentation

◆ getEnvironment()

const IlEnvironment* IldNumeric::getEnvironment ( ) const

Gets the object reference environment.

Returns
The reference environment as a const object.

◆ isBad()

IlBoolean IldNumeric::isBad ( ) const

Indicates if the last function called for this object failed.

Note
As a consequence, the results produced by the said call are undefined.

◆ set() [1/3]

IlBoolean IldNumeric::set ( const char *  value)

Assigns a new value for the instance.

Parameters
valueThe new value to set.

This function assigns value as the value of the invoking instance of IldNumeric. The input string must conform to the same format as the one given in the constructor.

See also
IldNumeric(IlEnvironment*, const char*).

◆ set() [2/3]

IlBoolean IldNumeric::set ( double  value)

Assigns a new value for the instance.

Parameters
valueThe new value to set.

This function assigns value as the value of the invoking instance of IldNumeric.

See also
IldNumeric(IlEnvironment*, double).

◆ set() [3/3]

IlBoolean IldNumeric::set ( long  value)

Assigns a new value for the instance.

Parameters
valueThe new value to set.

This function assigns value as the value of the invoking instance of IldNumeric.

See also
IldNumeric(IlEnvironment*, long).

◆ setEnvironment()

const IlEnvironment* IldNumeric::setEnvironment ( IlEnvironment env)

Sets the object reference environment.

Returns
The previous environment.