Tools.h++ Manual
104011 Tandem Computers Incorporated 21-135
21
Public member functions
virtual RWCString asString( long) const = 0;
virtual RWCString asString(unsigned long) const = 0;
Converts the number to a string (e.g.,
"3,456"
).
virtual RWCString asString(double f, int precision = 6,
RWBoolean showpoint = 0) const = 0;
Converts the double f to a string. The variable precision is the number of
digits to place after the decimal separator. If showpoint is
TRUE
, the decimal
separator will appear regardless of the precision.
virtual RWCString asString(struct tm* tmbuf,
char format, const RWZone& zone) const = 0
;
Converts components of the struct tm object to a string, according to the
format character. The meanings assigned to the format character are identical
to those used in the Standard C Library function
strftime()
. The members
of struct tm are assumed to be set consistently. See Table 21-2 for a summary of
strftime()
formatting characters.
virtual RWCString moneyAsString(double value,
enum CurrSymbol = LOCAL) const = 0
;
Returns a string containing the
value
argument formatted according to
monetary conventions for the locale. The
value
argument is assumed to
contain an integer representing the number of units of currency (e.g.,
moneyAsString(1000., RWLocale::LOCAL
) in a US locale would yield
"$10.00"
). The
CurrSymbol
argument determines whether the local (e.g.,
"$"
) or international (e.g.,
"USD "
) currency symbol is applied, or none.
virtual RWBooleanstringToNum(const RWCString&, double* fp)
const = 0
;
Interprets the
RWCString
argument as a floating point number. Spaces are
allowed before and after the (optional) sign, and at the end. Digit group
separators are allowed in the integer portion. Returns
TRUE
for a valid
number,
FALSE
for an error. If it returns
FALSE
, the
double*
argument is
untouched. All valid numeric strings are accepted; all others are rejected. The
following are examples of valid numeric strings in an English-speaking locale:
"1" " -02. " ".3"
"1234.56" "1e10" "+ 19,876.2E+20"
virtual RWBooleanstringToNum(const RWCString&, long* ip)
const = 0
;
Interprets the
RWCString
argument as an integer. Spaces are allowed before
and after the (optional) sign, and at the end. Digit group separators are