currency Class Reference

Class representing a numbered amount with a fixed decimal point. More...

#include <currency.h>

Inheritance diagram for currency:
Inheritance graph
[legend]
Collaboration diagram for currency:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 currency (void)
 currency (const currency &)
 currency (currency *)
 currency (long long)
 currency (const class value &)
 currency (class value *)
 currency (double)
 ~currency (void)
 operator long long (void)
const char * str (void) const
const char * cval (void) const
long long value (void) const
virtual void init (bool first)



currencyoperator= (long long)
currencyoperator= (const currency &)
currencyoperator= (currency *)
currencyoperator= (const class value &)
currencyoperator= (class value *)
currencyoperator= (double)
long long operator+ (long long) const
long long operator+ (const currency &) const
long long operator- (long long) const
long long operator- (const currency &) const
currencyoperator+= (long long)
currencyoperator+= (const currency &)
currencyoperator-= (long long)
currencyoperator-= (const currency &)
currencyoperator*= (int)
currencyoperator*= (double)
currencyoperator*= (const currency &)
currencyoperator*= (long long)
currencyoperator/= (int)
currencyoperator/= (double)
currencyoperator/= (const currency &)
currencyoperator/= (long long)
long long operator* (int) const
long long operator* (double) const
long long operator* (const currency &) const
long long operator* (long long) const
long long operator/ (int) const
long long operator/ (double) const
long long operator/ (const currency &) const
long long operator/ (long long) const
bool operator== (const currency &) const
bool operator== (long long) const
bool operator!= (const currency &) const
bool operator!= (long long) const
bool operator< (const currency &) const
bool operator< (long long) const
bool operator<= (const currency &) const
bool operator<= (long long) const
bool operator> (const currency &) const
bool operator> (long long) const
bool operator>= (const currency &) const
bool operator>= (long long) const

Protected Attributes

long long val
char presentation [24]

Detailed Description

Class representing a numbered amount with a fixed decimal point.

Internally, the amount is stored with three decimal places of accuracy and uses this for calculations. When converting the currency for display, however, it is rounded to two decimal places.


Constructor & Destructor Documentation

currency::currency ( long long  orig  ) 

Copy constructor for currency cast as 64 bits fixed point decimal.

References val.


Member Function Documentation

const char * currency::str ( void   )  const

Convert to string.

Prints with two digits behind the decimal point, rounded up from .005.

References presentation, and val.

Referenced by cval().


The documentation for this class was generated from the following files:

Generated on Sun Feb 28 10:35:24 2010 for GRACE by  doxygen 1.6.1