DCL 3.7.4
Loading...
Searching...
No Matches
Decimal Class Reference

#include <Numeric.h>

Public Member Functions

 Decimal ()
 Decimal (const Decimal &_value)
 Decimal (int32_t _n)
 Decimal (uint32_t _u)
 Decimal (int64_t _n)
 Decimal (uint64_t _u)
 Decimal (float f)
 Decimal (double d)
 Decimal (const String &strNumber)
void assign (const wchar_t *_number, int _n)
const Decimaloperator= (const Decimal &_value)
const Decimaloperator= (int32_t _n)
const Decimaloperator= (uint32_t _u)
const Decimaloperator= (int64_t _n)
const Decimaloperator= (uint64_t _u)
const Decimaloperator= (float _value)
const Decimaloperator= (double _value)
const Decimaloperator= (const String &strNumber)
String toString () const
String toStringF (const char *pszDecimalFormat=NULL) const

Static Public Member Functions

static String toString (const Decimal &_value)
static String toStringF (const Decimal &_value, const char *pszDecimalFormat=NULL)

Static Public Attributes

static const char * FORMAT_STRING = "#,###.####"

Protected Attributes

String __value

Detailed Description

Definition at line 214 of file Numeric.h.

Constructor & Destructor Documentation

◆ Decimal() [1/9]

Decimal::Decimal ( )
inline

Definition at line 159 of file Numeric.inl.

160{
161}

◆ Decimal() [2/9]

Decimal::Decimal ( const Decimal & _value)
inline

Definition at line 163 of file Numeric.inl.

164 : __value(_value.__value)
165{
166}
String __value
Definition Numeric.h:217

◆ Decimal() [3/9]

Decimal::Decimal ( int32_t _n)
inline

Definition at line 178 of file Numeric.inl.

179{
180 *this = _n;
181}

◆ Decimal() [4/9]

Decimal::Decimal ( uint32_t _u)
inline

Definition at line 183 of file Numeric.inl.

184{
185 *this = _u;
186}

◆ Decimal() [5/9]

Decimal::Decimal ( int64_t _n)
inline

Definition at line 188 of file Numeric.inl.

189{
190 *this = _n;
191}

◆ Decimal() [6/9]

Decimal::Decimal ( uint64_t _u)
inline

Definition at line 193 of file Numeric.inl.

194{
195 *this = _u;
196}

◆ Decimal() [7/9]

Decimal::Decimal ( float f)
inline

Definition at line 198 of file Numeric.inl.

199{
200 *this = f;
201}

◆ Decimal() [8/9]

Decimal::Decimal ( double d)
inline

Definition at line 203 of file Numeric.inl.

204{
205 *this = d;
206}

◆ Decimal() [9/9]

Decimal::Decimal ( const String & strNumber)
inline

Definition at line 208 of file Numeric.inl.

209 : __value(strNumber)
210{
211}

Member Function Documentation

◆ assign()

void Decimal::assign ( const wchar_t * _number,
int _n )
inline

Definition at line 213 of file Numeric.inl.

214{
215 __value.assign(_number, _n);
216}

◆ operator=() [1/8]

const Decimal & Decimal::operator= ( const Decimal & _value)
inline

Definition at line 218 of file Numeric.inl.

219{
220 __value = _value.__value;
221 return *this;
222}

◆ operator=() [2/8]

const Decimal & Decimal::operator= ( const String & strNumber)
inline

Definition at line 270 of file Numeric.inl.

271{
272 __value = strNumber;
273 return *this;
274}

◆ operator=() [3/8]

const Decimal & Decimal::operator= ( double _value)

Definition at line 993 of file Numeric.cpp.

994{
995 __value = __GetDecimalString(_value);
996 return *this;
997}

◆ operator=() [4/8]

const Decimal & Decimal::operator= ( float _value)

Definition at line 987 of file Numeric.cpp.

988{
989 __value = __GetDecimalString(_value);
990 return *this;
991}

◆ operator=() [5/8]

const Decimal & Decimal::operator= ( int32_t _n)
inline

Definition at line 246 of file Numeric.inl.

247{
248 __value = Int32::toString(_n, 10);
249 return *this;
250}
String toString(unsigned _base=10) const
Definition Numeric.inl:93

◆ operator=() [6/8]

const Decimal & Decimal::operator= ( int64_t _n)
inline

Definition at line 258 of file Numeric.inl.

259{
260 __value = Int64::toString(_n, 10);
261 return *this;
262}
String toString(unsigned _base=10) const
Definition Numeric.inl:117

◆ operator=() [7/8]

const Decimal & Decimal::operator= ( uint32_t _u)
inline

Definition at line 252 of file Numeric.inl.

253{
254 __value = UInt32::toString(_u, 10);
255 return *this;
256}
String toString(unsigned _base=10) const
Definition Numeric.inl:105

◆ operator=() [8/8]

const Decimal & Decimal::operator= ( uint64_t _u)
inline

Definition at line 264 of file Numeric.inl.

265{
266 __value = UInt64::toString(_u, 10);
267 return *this;
268}
String toString(unsigned _base=10) const
Definition Numeric.inl:129

◆ toString() [1/2]

String Decimal::toString ( ) const
inline

Definition at line 276 of file Numeric.inl.

277{
278 return __value;
279}

◆ toString() [2/2]

String Decimal::toString ( const Decimal & _value)
static

◆ toStringF() [1/2]

String Decimal::toStringF ( const char * pszDecimalFormat = NULL) const
inline

Definition at line 281 of file Numeric.inl.

284{
285 return Decimal::toStringF(*this, pszDecimalFormat);
286}
String toStringF(const char *pszDecimalFormat=NULL) const
Definition Numeric.inl:281

◆ toStringF() [2/2]

String Decimal::toStringF ( const Decimal & _value,
const char * pszDecimalFormat = NULL )
static

Definition at line 999 of file Numeric.cpp.

1002{
1003#if 0
1004 if (!pszDecimalFormat)
1005 pszDecimalFormat = FORMAT_STRING;
1006
1007 __DCL_ASSERT(*pszDecimalFormat != '\0');
1008
1009 return formatDecimalString(
1010 _value.__value,
1011 pszDecimalFormat
1012 );
1013#endif
1014 return String();
1015}
#define __DCL_ASSERT(expr)
Definition Object.h:394
static const char * FORMAT_STRING
Definition Numeric.h:250

Member Data Documentation

◆ __value

String Decimal::__value
protected

Definition at line 217 of file Numeric.h.

◆ FORMAT_STRING

const char * Decimal::FORMAT_STRING = "#,###.####"
static

Definition at line 250 of file Numeric.h.


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