comet::currency_t Class Reference
[Com type wrappers.]

#include <currency.h>

List of all members.

Public Member Functions

 currency_t () throw ()
 Default Constructor.
 currency_t (const CY &cy)
 CY constructor.
 currency_t (double val)
 Double Conversion constructor.
 currency_t (long val)
 Long Conversion constructor.
 currency_t (int val)
void swap (currency_t &c) throw ()
currency_tround_to (int decimals)
int cmp (const currency_t &cy) const
int cmp (double cy) const
std::basic_string< TCHAR > format (int mindigits=0, int minprecision=0, int width=0) const
 Format the string with the given digits, precision and width.
currency_tparse (const bstr_t &str, LCID locale=::GetThreadLocale())
 Parse the string to a currency.
bool valid () const throw ()
 Returns true if this is a valid number.
CY detach () throw ()
 Detaches the CY value. Provided for consistancy.
Assignment Operators
currency_toperator= (double newVal)
currency_toperator= (long newVal)
currency_toperator= (int newVal)
currency_toperator= (const tagCY &newVal) throw ()
Mathematical Operators
currency_toperator+= (const currency_t &cy)
currency_toperator-= (const currency_t &cy)
currency_toperator *= (const currency_t &cy)
currency_toperator *= (long cy)
currency_toperator *= (int val)
currency_toperator *= (double val)
currency_toperator/= (int val) const
currency_toperator/= (long val)
currency_t operator+ (const currency_t &cy) const
currency_t operator- (const currency_t &cy) const
currency_t operator * (const currency_t &cy) const
currency_t operator * (long cy) const
currency_t operator * (int cy) const
currency_t operator * (double cy) const
double operator/ (const currency_t &cy) const
 Calculate approximate ratio.
currency_t operator/ (int val) const
 Divide by int.
currency_t operator/ (long val) const
 Divide by long.
double operator/ (double val) const
 Divide by double.
currency_t operator- () const
 Unary negate.
Logical Operators
bool operator!= (const currency_t &cy) const
bool operator!= (double val) const
bool operator== (const currency_t &cy) const
bool operator== (double val) const
bool operator<= (const currency_t &cy) const
bool operator<= (double val) const
bool operator>= (const currency_t &cy) const
bool operator>= (double val) const
bool operator< (const currency_t &cy) const
bool operator< (double val) const
bool operator> (const currency_t &cy) const
bool operator> (double val) const
Access converters
tagCY get () const
tagCY in () const
tagCY * in_ptr () const
tagCY * out ()
tagCY * inout ()

Static Public Member Functions

const currency_tcreate_const_reference (const CY &s) throw ()
currency_tcreate_reference (CY &s) throw ()
CY detach (currency_t &cy) throw ()
 Detaches the CY value. Provided for consistancy.

Protected Member Functions

template<typename CH> void do_format (std::basic_string< CH > &val, int mindigits, int minprecision, int) const

Friends

std::basic_ostream< char > & operator<< (std::basic_ostream< char > &str, const currency_t &val)
std::basic_ostream< wchar_t > & operator<< (std::basic_ostream< wchar_t > &str, const currency_t &val)


Detailed Description

Wrapper for CURRENCY type. CURRENCY is a fixed point (to 4 decimal places) 64 bit value.


Member Function Documentation

int comet::currency_t::cmp double  cy  )  const [inline]
 

Compares the value like strcmp.

Parameters:
cy Number to be compared.

int comet::currency_t::cmp const currency_t cy  )  const [inline]
 

Compares the value like strcmp.

Parameters:
cy Number to be compared.

template<typename CH>
void comet::currency_t::do_format std::basic_string< CH > &  val,
int  mindigits,
int  minprecision,
int 
const [inline, protected]
 

Return a string representation of the value.

Parameters:
val output string (return values can't automatically detect template arguments)
mindigits Minimum number before decimal point.
minprecision Minimum number after decimal point.
Todo:
Obey ostream formats for: fillchar(), ios_base::left, ios_base::internal, ios_base::showpos

currency_t& comet::currency_t::round_to int  decimals  )  [inline]
 

Rounds the value to specified number of decimal places.

Parameters:
decimals Number of places to round to.


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