DCL 4.0
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 m_value

Detailed Description

Definition at line 196 of file Numeric.h.

Constructor & Destructor Documentation

◆ Decimal() [1/9]

Decimal::Decimal ( )
inline

Definition at line 153 of file Numeric.inl.

154{
155}

◆ Decimal() [2/9]

Decimal::Decimal ( const Decimal & value)
inline

Definition at line 157 of file Numeric.inl.

158 : m_value(value.m_value)
159{
160}
String m_value
Definition Numeric.h:199

◆ Decimal() [3/9]

Decimal::Decimal ( int32_t _n)
inline

Definition at line 172 of file Numeric.inl.

173{
174 *this = _n;
175}

◆ Decimal() [4/9]

Decimal::Decimal ( uint32_t _u)
inline

Definition at line 177 of file Numeric.inl.

178{
179 *this = _u;
180}

◆ Decimal() [5/9]

Decimal::Decimal ( int64_t _n)
inline

Definition at line 182 of file Numeric.inl.

183{
184 *this = _n;
185}

◆ Decimal() [6/9]

Decimal::Decimal ( uint64_t _u)
inline

Definition at line 187 of file Numeric.inl.

188{
189 *this = _u;
190}

◆ Decimal() [7/9]

Decimal::Decimal ( float f)
inline

Definition at line 192 of file Numeric.inl.

193{
194 *this = f;
195}

◆ Decimal() [8/9]

Decimal::Decimal ( double d)
inline

Definition at line 197 of file Numeric.inl.

198{
199 *this = d;
200}

◆ Decimal() [9/9]

Decimal::Decimal ( const String & strNumber)
inline

Definition at line 202 of file Numeric.inl.

203 : m_value(strNumber)
204{
205}

Member Function Documentation

◆ assign()

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

Definition at line 207 of file Numeric.inl.

208{
209 m_value.assign(_number, _n);
210}

◆ operator=() [1/8]

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

Definition at line 212 of file Numeric.inl.

213{
214 m_value = value.m_value;
215 return *this;
216}

◆ operator=() [2/8]

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

Definition at line 264 of file Numeric.inl.

265{
266 m_value = strNumber;
267 return *this;
268}

◆ operator=() [3/8]

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

Definition at line 972 of file Numeric.cpp.

973{
974 m_value = __GetDecimalString(value);
975 return *this;
976}

◆ operator=() [4/8]

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

Definition at line 966 of file Numeric.cpp.

967{
968 m_value = __GetDecimalString(value);
969 return *this;
970}

◆ operator=() [5/8]

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

Definition at line 240 of file Numeric.inl.

241{
242 m_value = Int32::toString(_n, 10);
243 return *this;
244}
String toString(unsigned _base=10) const
Definition Numeric.inl:87

◆ operator=() [6/8]

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

Definition at line 252 of file Numeric.inl.

253{
254 m_value = Int64::toString(_n, 10);
255 return *this;
256}
String toString(unsigned _base=10) const
Definition Numeric.inl:111

◆ operator=() [7/8]

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

Definition at line 246 of file Numeric.inl.

247{
248 m_value = UInt32::toString(_u, 10);
249 return *this;
250}
String toString(unsigned _base=10) const
Definition Numeric.inl:99

◆ operator=() [8/8]

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

Definition at line 258 of file Numeric.inl.

259{
260 m_value = UInt64::toString(_u, 10);
261 return *this;
262}
String toString(unsigned _base=10) const
Definition Numeric.inl:123

◆ toString() [1/2]

String Decimal::toString ( ) const
inline

Definition at line 270 of file Numeric.inl.

271{
272 return m_value;
273}

◆ 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 275 of file Numeric.inl.

278{
279 return Decimal::toStringF(*this, pszDecimalFormat);
280}
String toStringF(const char *pszDecimalFormat=NULL) const
Definition Numeric.inl:275

◆ toStringF() [2/2]

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

Definition at line 978 of file Numeric.cpp.

981{
982#if 0
983 if (!pszDecimalFormat)
984 pszDecimalFormat = FORMAT_STRING;
985
986 __DCL_ASSERT(*pszDecimalFormat != '\0');
987
988 return formatDecimalString(
989 value.m_value,
990 pszDecimalFormat
991 );
992#endif
993 return String();
994}
#define __DCL_ASSERT(expr)
Definition Object.h:371
static const char * FORMAT_STRING
Definition Numeric.h:232

Member Data Documentation

◆ FORMAT_STRING

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

Definition at line 232 of file Numeric.h.

◆ m_value

String Decimal::m_value
protected

Definition at line 199 of file Numeric.h.


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