00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef RTKMONEY_H
00022 #define RTKMONEY_H
00023
00024
00029 #include <qstring.h>
00030
00031 namespace RTK
00032 {
00033
00034 class Money
00035 {
00036 public:
00037 Money(short int ndecimals =2);
00038 Money(long long amount, short int ndecimals =2);
00039 Money(long amount, short int ndecimals =2);
00040 Money(double amount, short int ndecimals =2);
00041
00042 QString toString() const;
00043 int toInt() const;
00044 double toDouble() const;
00045 long long toLong() const;
00046
00047 bool operator==( const Money& other) const;
00048 bool operator!=( const Money& other) const;
00049 bool operator<( const Money& other) const;
00050 bool operator<=( const Money& other) const;
00051 bool operator>( const Money& other) const;
00052 bool operator>=( const Money& other) const;
00053 Money &operator+=( const Money& other);
00054 Money operator+( const Money& other) const;
00055 Money operator-( const Money& other) const;
00056 Money operator*( const Money& other) const;
00057 Money operator/( const Money& other) const;
00058
00059 private:
00060 long long mAmount;
00061 int mCentFactor;
00062 long long getAmount() const;
00063 };
00064
00065 };
00066
00067 #endif