Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Currency Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWDecimalPortable

Module:  Currency   Group:  Decimal


RWDecimalPortable RWDecimalBase

Local Index

Members

Non-Members

Synopsis

#include <rw/decport.h>

RWDecimalPortable dec;     // construct a decimal == 0
dec = "1.23";              // construct a decimal == 1.23

Description

RWDecimalPortable represents an arbitrary precision decimal fraction.

The RWDecimalPortable class is designed to provide maximum portability. The portability achieved in RWDecimalPortable is gained at the expense of speed and power. For example, RWDecimalPortable does not support all of the functionality of the other decimal classes. In most cases we recommend that you use another of the decimal classes, but in situations in which the portability of a number is paramount, RWDecimalPortable is useful.

Related Classes

RWDecimalBase contains the following enum, used by the round() method:

enum RoundingMethod { PLAIN = 0, UP = 1, DOWN = 2, 
                      BANKERS = 3, TRUNCATE = 2 };

Public Constructors

RWDecimalPortable();
RWDecimalPortable(const char* input);
RWDecimalPortable(long intPart);

Public Member Operator

operator RWCString();

Public Member Functions

virtual RWspace
binaryStoreSize() const;
friend unsigned
hash() const;
bool
isNumber() const;
friend void
restoreFrom(RWFile& file);
friend void
restoreFrom(RWvistream& vis);
friend void
saveOn(RWFile& file) const;
friend void
saveOn(RWvostream& vos) const;
void
trimZeros();

Related Global Functions

RWDecimalPortable
round(const RWDecimalPortable&, int digits,
      RoundingMethod = RWDecimalBase::PLAIN);
double
toDouble(const RWDecimalPortable&);

Related Global Operators

RWDecimalPortable 
operator-(const RWDecimalPortable&);
RWDecimalPortable 
operator+(const RWDecimalPortable&,
          const RWDecimalPortable&);
RWDecimalPortable 
operator-(const RWDecimalPortable&, 
          const RWDecimalPortable&);
RWDecimalPortable 
operator*(const RWDecimalPortable&,
          const RWDecimalPortable&);
bool 
operator==(const RWDecimalPortable& x, 
           const RWDecimalPortable& y);
bool 
operator>=(const RWDecimalPortable& x, 
           const RWDecimalPortable& y);
bool 
operator!=(const RWDecimalPortable& x, 
           const RWDecimalPortable& y);
bool 
operator<(const RWDecimalPortable& x, 
          const RWDecimalPortable& y);
bool 
operator>(const RWDecimalPortable& x, 
          const RWDecimalPortable& y);
bool 
operator<=(const RWDecimalPortable& x, 
           const RWDecimalPortable& y);
ostream&
operator<<(ostream&, const RWDecimalPortable&);
ostream&
operator>>(istream&, RWDecimalPortable&);


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.