#include <lknumeric.h>
Inheritance diagram for look::LookNumeric::
Public Methods | |
LookNumeric () | |
Constructor. | |
LookNumeric (long theValue) | |
Construct from long. | |
LookNumeric (const LookInteger &theInt) | |
Construct from LookInteger. | |
LookNumeric (const LookMoney &theMoney) | |
Construct from LookMoney. | |
LookNumeric (const LookFloat &theFloat, int thePrecision) | |
Construct from LookFloat. More... | |
~LookNumeric (void) | |
Destructor. | |
LookNumeric (const LookNumeric &theOther) | |
Copy constructor. | |
LookNumeric& | operator= (const LookNumeric &theOther) |
Assignment. | |
LookNumeric& | operator= (long theValue) |
Assignment from long. | |
LookNumeric& | operator= (const LookInteger &theInt) |
Assignment from LookInteger. | |
LookNumeric& | operator= (const LookMoney &theMoney) |
Assignment from LookMoney. | |
LookTypeBase* | GetNewCopy (void) const |
Get a new copy. More... | |
long | GetTypeID (void) const |
Get Type ID. More... | |
void | SetFloat (const LookFloat &theFloat, int thePrecision) |
Set from a float. More... | |
LookFloat | GetFloat (void) |
Conversion to LookFloat. | |
LookInteger | GetInteger (void) |
Conversion to LookInteger. | |
LookMoney | GetMoney (void) |
Conversion to LookMoney. | |
bool | Set (const LookString &theString) |
Conversion from string. More... | |
LookString | GetString (void) const |
Get as a string. More... | |
Protected Attributes | |
LookString | itsString |
Its value as a string. |
This stores the number as a string, so there are no rounding issues.
Conversions to/from the various number types (LookInteger, LookMoney, LookFloat) are provided.
This is used when databases return numbers as strings (which for money is a good thing - better than float).
|
Construct from LookFloat. This uses LookFloat::GetString() to get the string - a precision is required as floats can't necessarily be exactly represented in decimal.
|
|
Get a new copy. Virtual copy constructor, aka clone.
Reimplemented from look::LookTypeBase. |
|
Get as a string.
|
|
Get Type ID. Pseudo-rtti, or isA.
Reimplemented from look::LookTypeBase. |
|
Conversion from string. No checking is performed to see if theString is a number. This means subsequent conversion to number types may not work if theString is invalid.
|
|
Set from a float. A precision is required, so the assignment operator won't do. Uses LookFloat::GetString().
|