rwlogo

Rogue Wave DBLink API Reference Guide

Product Documentation:

Rogue Wave DBLink
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)
 Build an IldNumeric instance. More...
 
 IldNumeric (IlEnvironment *env, const char *value)
 Build an initialized IldNumeric instance. More...
 
 IldNumeric (IlEnvironment *env, long value)
 Build an initialized IldNumeric instance. More...
 
 IldNumeric (IlEnvironment *env, double value)
 Build an initialized IldNumeric instance. More...
 
void get (UnicodeString &ustr)
 Get the value in a unicode string. More...
 
const IlEnvironmentgetEnvironment () const
 Get the object reference environment. More...
 
IlBoolean isBad () const
 Tell if the last function called for this object failed. More...
 
IlBoolean set (const char *value)
 Assign a new value for the instance. More...
 
IlBoolean set (long value)
 Assign a new value for the instance. More...
 
IlBoolean set (double value)
 Assign a new value for the instance. More...
 
const IlEnvironmentsetEnvironment (IlEnvironment *env)
 Set 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::IldNumeric ( IlEnvironment env)

Build an 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::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::IldNumeric ( IlEnvironment env,
long  value 
)

Build an initialized IldNumeric instance.

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

This constructor creates and returns an instance of IldNumeric and initializes it with the integer contained in value.

IldNumeric::IldNumeric ( IlEnvironment env,
double  value 
)

Build an initialized IldNumeric instance.

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

This constructor creates and returns an instance of IldNumeric and initializes it with the real number contained in value.

Member Function Documentation

void IldNumeric::get ( UnicodeString &  ustr)

Get the value in a unicode string.

Parameters
ustrA reference to a UnicodeString

On output, ustr will be filled with the formatted number, represented by the instance, according to the locale of the environment. If the environment was not set in the instance, the format will be those used by the constructor.

See Also
IldNumeric(IlEnvironment*, const char*)
const IlEnvironment* IldNumeric::getEnvironment ( ) const

Get the object reference environment.

Returns
The reference environment as a const object.
IlBoolean IldNumeric::isBad ( ) const

Tell if the last function called for this object failed.

Note
As a consequence, the results produced by the said call are undefined.
IlBoolean IldNumeric::set ( const char *  value)

Assign 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*)
IlBoolean IldNumeric::set ( long  value)

Assign 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)
IlBoolean IldNumeric::set ( double  value)

Assign 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)
const IlEnvironment* IldNumeric::setEnvironment ( IlEnvironment env)

Set the object reference environment.

Returns
The previous environment.

© Copyright 2014, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.