SourcePro® 2023.1 |
SourcePro® API Reference Guide |
Encapsulates formatting information for converting a decimal number to a string. More...
#include <rw/decio.h>
Friends | |
RWCString | operator<< (const RWDecimalFormat &, const RWDecimalPortable &) |
Additional Inherited Members | |
Public Types inherited from RWDecimalFormatScope | |
enum | Justification { LEFT, CENTER, RIGHT } |
enum | Sign { POSITIVE, NEGATIVE, BOTH } |
The RWDecimalFormat class encapsulates formatting information for converting a decimal number to a string. You can construct and modify the attributes of a formatted object in two ways:
$0___.__
". Using this sample picture, the number 3.14159
is formatted as "$0003.14
".You can also use a hybrid approach by initially constructing an RWDecimalFormat object using a picture string and then "fine tuning" the formatting parameters using the member functions to change attributes directly.
Once a formatted object is constructed, you use the function call operator() to convert from decimal numbers to strings.
Program output
The attributes used by the formatting object are shown in the following table. Two sets of attributes are maintained by the RWDecimalFormat class: one for formatting positive numbers and one for formatting negative numbers. Member functions that set an attribute have names like setAttribute(); member functions that obtain the current value of an attribute have names like attribute(). Each of these functions takes a parameter indicating whether the attribute for formatting positive values, negative values, or both is to be operated on:
Attribute | Description | Default |
---|---|---|
allDecimals | If false , the number of decimal places printed is given by the decimalPlaces attribute, otherwise all digits are printed. | false |
decimalPlaces | If allDecimals is false , this is the number of decimal places to print. Negative numbers are allowed. | 0 |
decimalSeparator | The decimal point symbol. | "." |
doRounding | If true , round the number before display. | false |
farLeftText | Text on the extreme left. | "" |
farRightText | Text on the extreme right. | "" |
fixedWidth | If false , the natural width of the number is used; if true , the width is fixed to the value of the width attribute | false |
justification | How to justify the number in the width provided (LEFT , RIGHT , or CENTER are allowed). | LEFT |
leftFillChar | Fill space to left of number with this character. | ' ' |
leftDigitSeparator | String that separates digits left of decimal point into groups. | "" |
leftGroupSize | Number of digits per group left of the decimal point. | 3 |
nearLeftText | String which goes just to the left of the number. Most often used for printing a currency symbol. | "" |
nearRightText | String which goes just to the right of the number. Most often used for printing a currency symbol. | "" |
rightDigitSeparator | String which separates digits right of decimal point into groups. | "" |
rightFillChar | Fill space to right of number with this character. | ' ' |
rightGroupSize | Number of digits per group right of the decimal point. | 3 |
roundMethod | The rounding mode used to truncate decimal places (PLAIN , LEFT , RIGHT , BANKERS , TRUNCATE are allowed). | PLAIN |
roundPlaces | Number of decimal places to round if doRounding attribute is true . Negative numbers are allowed. If the allDecimals attribute is false , and the decimalPlaces attribute is less than roundPlaces , then the number is rounded to the number of digits indicated by decimalPlaces . | 0 |
showDecimalPoint | If true , the decimal point is printed when exactly zero decimal places are displayed. | false |
width | If the fixedWidth attribute is true , this determines the width of the formatted number. | 0 |
A picture string uses text characters and their relative positions to indicate how to set formatting attributes. The width attribute is set to the length of the picture string. Other attributes are changed depending on the characters in the picture. The table below lists valid formatting characters. Most formatting characters can be placed in one of four positions:
Char | Affect | Illustration | Example number | Formatted number |
---|---|---|---|---|
@ | Indicates start of picture format string. Everything before the @ is taken as leading text. | Num=@____ | 4.32 | "Num=4.32" |
_ | Padding to make the width correct. | _________ | 12.346 | " 12.346" |
. | Indicates where the decimal point goes, and separates left from right formatting. | ______.__ | 12.346 | " 12.35" |
# | Separates left from right formatting. | _(_#_)_ | -12.3 | " (12.3)" |
( | Use '()' as the negative sign. | (____.__) | -12.3 | "( 12.3)" |
) | Use '()' as the negative sign. | _(___._)_ | -12.3 | " (12.3) " |
- | Use '-' as the negative sign, with position as indicated. | -_____.__ _____.__- | -12.34 -12.34 | "- 12.34" " 12.34-" |
+ | Use '+' as the plus sign, with position as indicated. | _+____.__ | 12.34 | " +12.34" |
0 | Set padding character to '0', rather than blank. Affects either before or after the decimal point. | +0___.__0 | 12.34 | "+0012.340" |
L | Left justify the number. | L_____.__ | 12.34 | " 12.34 " |
C | Center justify the number. | C_____.__ | 12.34 | " 12.34 " |
, | Separate characters before/after the decimal point into groups of three. | ,_____.__ | 1234.98 | " 1,234.98" |
$ | Add the currency symbol '$' in the position indicated. | $_____.__ | 12.34 | "$ 12.34" |
If the width attribute is smaller than needed for the number to be output, the output is marked with one or more width overflow characters (currently "*
" is used). If the number would have to be truncated to the left of the decimal point in order to fit in the specified width, then the entire field is filled with width overflow characters. If the number can be made to fit by truncating at or to the right of the decimal place, then the number is output with a single trailing overflow character to indicate that truncation took place. For example, the following statements produce the strings shown:
RWDecimalFormat::RWDecimalFormat | ( | ) |
Constructs an RWDecimalFormat with default attributes.
RWDecimalFormat::RWDecimalFormat | ( | const char * | fmt | ) |
Constructs an RWDecimalFormat object using the picture string provided.
bool RWDecimalFormat::allDecimals | ( | Sign | ) | const |
This function returns the current value of the indicated attribute. If the Sign
parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is returned. If the Sign
parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is returned. If the value of Sign
is RWDecimalFormat::BOTH and the attribute values for formatting positive and negative values are different, an exception is thrown. Otherwise, the common value is returned. See the Attributes section for details on how each attribute affects formatting.
int RWDecimalFormat::decimalPlaces | ( | Sign | ) | const |
This function returns the current value of the indicated attribute. If the Sign
parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is returned. If the Sign
parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is returned. If the value of Sign
is RWDecimalFormat::BOTH and the attribute values for formatting positive and negative values are different, an exception is thrown. Otherwise, the common value is returned. See the Attributes section for details on how each attribute affects formatting.
This function returns the current value of the indicated attribute. If the Sign
parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is returned. If the Sign
parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is returned. If the value of Sign
is RWDecimalFormat::BOTH and the attribute values for formatting positive and negative values are different, an exception is thrown. Otherwise, the common value is returned. See the Attributes section for details on how each attribute affects formatting.
bool RWDecimalFormat::doRounding | ( | Sign | ) | const |
This function returns the current value of the indicated attribute. If the Sign
parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is returned. If the Sign
parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is returned. If the value of Sign
is RWDecimalFormat::BOTH and the attribute values for formatting positive and negative values are different, an exception is thrown. Otherwise, the common value is returned. See the Attributes section for details on how each attribute affects formatting.
This function returns the current value of the indicated attribute. If the Sign
parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is returned. If the Sign
parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is returned. If the value of Sign
is RWDecimalFormat::BOTH and the attribute values for formatting positive and negative values are different, an exception is thrown. Otherwise, the common value is returned. See the Attributes section for details on how each attribute affects formatting.
This function returns the current value of the indicated attribute. If the Sign
parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is returned. If the Sign
parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is returned. If the value of Sign
is RWDecimalFormat::BOTH and the attribute values for formatting positive and negative values are different, an exception is thrown. Otherwise, the common value is returned. See the Attributes section for details on how each attribute affects formatting.
bool RWDecimalFormat::fixedWidth | ( | Sign | ) | const |
This function returns the current value of the indicated attribute. If the Sign
parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is returned. If the Sign
parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is returned. If the value of Sign
is RWDecimalFormat::BOTH and the attribute values for formatting positive and negative values are different, an exception is thrown. Otherwise, the common value is returned. See the Attributes section for details on how each attribute affects formatting.
Justification RWDecimalFormat::justification | ( | Sign | ) | const |
This function returns the current value of the indicated attribute. If the Sign
parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is returned. If the Sign
parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is returned. If the value of Sign
is RWDecimalFormat::BOTH and the attribute values for formatting positive and negative values are different, an exception is thrown. Otherwise, the common value is returned. See the Attributes section for details on how each attribute affects formatting.
This function returns the current value of the indicated attribute. If the Sign
parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is returned. If the Sign
parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is returned. If the value of Sign
is RWDecimalFormat::BOTH and the attribute values for formatting positive and negative values are different, an exception is thrown. Otherwise, the common value is returned. See the Attributes section for details on how each attribute affects formatting.
char RWDecimalFormat::leftFillChar | ( | Sign | ) | const |
This function returns the current value of the indicated attribute. If the Sign
parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is returned. If the Sign
parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is returned. If the value of Sign
is RWDecimalFormat::BOTH and the attribute values for formatting positive and negative values are different, an exception is thrown. Otherwise, the common value is returned. See the Attributes section for details on how each attribute affects formatting.
unsigned RWDecimalFormat::leftGroupSize | ( | Sign | ) | const |
This function returns the current value of the indicated attribute. If the Sign
parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is returned. If the Sign
parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is returned. If the value of Sign
is RWDecimalFormat::BOTH and the attribute values for formatting positive and negative values are different, an exception is thrown. Otherwise, the common value is returned. See the Attributes section for details on how each attribute affects formatting.
This function returns the current value of the indicated attribute. If the Sign
parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is returned. If the Sign
parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is returned. If the value of Sign
is RWDecimalFormat::BOTH and the attribute values for formatting positive and negative values are different, an exception is thrown. Otherwise, the common value is returned. See the Attributes section for details on how each attribute affects formatting.
This function returns the current value of the indicated attribute. If the Sign
parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is returned. If the Sign
parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is returned. If the value of Sign
is RWDecimalFormat::BOTH and the attribute values for formatting positive and negative values are different, an exception is thrown. Otherwise, the common value is returned. See the Attributes section for details on how each attribute affects formatting.
RWCString RWDecimalFormat::operator() | ( | const char * | ) | const |
Formats the number and returns the resulting string. The number must consist of an optional plus or minus sign followed by a sequence of digits. The digit sequence may contain a decimal point.
RWCString RWDecimalFormat::operator() | ( | const RWDecimalPortable & | ) | const |
Formats the number and returns the resulting string.
This function returns the current value of the indicated attribute. If the Sign
parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is returned. If the Sign
parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is returned. If the value of Sign
is RWDecimalFormat::BOTH and the attribute values for formatting positive and negative values are different, an exception is thrown. Otherwise, the common value is returned. See the Attributes section for details on how each attribute affects formatting.
char RWDecimalFormat::rightFillChar | ( | Sign | ) | const |
This function returns the current value of the indicated attribute. If the Sign
parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is returned. If the Sign
parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is returned. If the value of Sign
is RWDecimalFormat::BOTH and the attribute values for formatting positive and negative values are different, an exception is thrown. Otherwise, the common value is returned. See the Attributes section for details on how each attribute affects formatting.
unsigned RWDecimalFormat::rightGroupSize | ( | Sign | ) | const |
This function returns the current value of the indicated attribute. If the Sign
parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is returned. If the Sign
parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is returned. If the value of Sign
is RWDecimalFormat::BOTH and the attribute values for formatting positive and negative values are different, an exception is thrown. Otherwise, the common value is returned. See the Attributes section for details on how each attribute affects formatting.
RWDecimalBase::RoundingMethod RWDecimalFormat::roundMethod | ( | Sign | ) | const |
This function returns the current value of the indicated attribute. If the Sign
parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is returned. If the Sign
parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is returned. If the value of Sign
is RWDecimalFormat::BOTH and the attribute values for formatting positive and negative values are different, an exception is thrown. Otherwise, the common value is returned. See the Attributes section for details on how each attribute affects formatting.
int RWDecimalFormat::roundPlaces | ( | Sign | ) | const |
This function returns the current value of the indicated attribute. If the Sign
parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is returned. If the Sign
parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is returned. If the value of Sign
is RWDecimalFormat::BOTH and the attribute values for formatting positive and negative values are different, an exception is thrown. Otherwise, the common value is returned. See the Attributes section for details on how each attribute affects formatting.
This function sets the attribute associated with this formatter object. If the Sign parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is set. If the Sign parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is set. If the value of Sign is RWDecimalFormat::BOTH, the attribute value for formatting both positive and negative numbers is set. See the Attributes section to learn how each attribute affects formatting.
This function sets the attribute associated with this formatter object. If the Sign parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is set. If the Sign parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is set. If the value of Sign is RWDecimalFormat::BOTH, the attribute value for formatting both positive and negative numbers is set. See the Attributes section to learn how each attribute affects formatting.
This function sets the attribute associated with this formatter object. If the Sign parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is set. If the Sign parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is set. If the value of Sign is RWDecimalFormat::BOTH, the attribute value for formatting both positive and negative numbers is set. See the Attributes section to learn how each attribute affects formatting.
This function sets the attribute associated with this formatter object. If the Sign parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is set. If the Sign parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is set. If the value of Sign is RWDecimalFormat::BOTH, the attribute value for formatting both positive and negative numbers is set. See the Attributes section to learn how each attribute affects formatting.
This function sets the attribute associated with this formatter object. If the Sign parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is set. If the Sign parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is set. If the value of Sign is RWDecimalFormat::BOTH, the attribute value for formatting both positive and negative numbers is set. See the Attributes section to learn how each attribute affects formatting.
This function sets the attribute associated with this formatter object. If the Sign parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is set. If the Sign parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is set. If the value of Sign is RWDecimalFormat::BOTH, the attribute value for formatting both positive and negative numbers is set. See the Attributes section to learn how each attribute affects formatting.
This function sets the attribute associated with this formatter object. If the Sign parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is set. If the Sign parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is set. If the value of Sign is RWDecimalFormat::BOTH, the attribute value for formatting both positive and negative numbers is set. See the Attributes section to learn how each attribute affects formatting.
void RWDecimalFormat::setJustification | ( | Justification | x, |
Sign | = BOTH |
||
) |
This function sets the attribute associated with this formatter object. If the Sign parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is set. If the Sign parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is set. If the value of Sign is RWDecimalFormat::BOTH, the attribute value for formatting both positive and negative numbers is set. See the Attributes section to learn how each attribute affects formatting.
This function sets the attribute associated with this formatter object. If the Sign parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is set. If the Sign parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is set. If the value of Sign is RWDecimalFormat::BOTH, the attribute value for formatting both positive and negative numbers is set. See the Attributes section to learn how each attribute affects formatting.
This function sets the attribute associated with this formatter object. If the Sign parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is set. If the Sign parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is set. If the value of Sign is RWDecimalFormat::BOTH, the attribute value for formatting both positive and negative numbers is set. See the Attributes section to learn how each attribute affects formatting.
This function sets the attribute associated with this formatter object. If the Sign parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is set. If the Sign parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is set. If the value of Sign is RWDecimalFormat::BOTH, the attribute value for formatting both positive and negative numbers is set. See the Attributes section to learn how each attribute affects formatting.
void RWDecimalFormat::setLocale | ( | const RWLocaleSnapshot & | newLocale | ) |
Changes the interpretation of commas and decimal points in the picture strings of RWDecimalFormat. This method should only be called if the current locale, initialized at the start of a program, is not desired. This method does not affect the input/output parsing of RWDecimal and RWDecimalPortable objects; it only affects output for the current RWDecimalFormat object. For more information, see the section on localization in the Currency Module User's Guide.
This function sets the attribute associated with this formatter object. If the Sign parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is set. If the Sign parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is set. If the value of Sign is RWDecimalFormat::BOTH, the attribute value for formatting both positive and negative numbers is set. See the Attributes section to learn how each attribute affects formatting.
This function sets the attribute associated with this formatter object. If the Sign parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is set. If the Sign parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is set. If the value of Sign is RWDecimalFormat::BOTH, the attribute value for formatting both positive and negative numbers is set. See the Attributes section to learn how each attribute affects formatting.
This function sets the attribute associated with this formatter object. If the Sign parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is set. If the Sign parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is set. If the value of Sign is RWDecimalFormat::BOTH, the attribute value for formatting both positive and negative numbers is set. See the Attributes section to learn how each attribute affects formatting.
This function sets the attribute associated with this formatter object. If the Sign parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is set. If the Sign parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is set. If the value of Sign is RWDecimalFormat::BOTH, the attribute value for formatting both positive and negative numbers is set. See the Attributes section to learn how each attribute affects formatting.
This function sets the attribute associated with this formatter object. If the Sign parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is set. If the Sign parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is set. If the value of Sign is RWDecimalFormat::BOTH, the attribute value for formatting both positive and negative numbers is set. See the Attributes section to learn how each attribute affects formatting.
void RWDecimalFormat::setRoundMethod | ( | RWDecimalBase::RoundingMethod | x, |
Sign | = BOTH |
||
) |
This function sets the attribute associated with this formatter object. If the Sign parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is set. If the Sign parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is set. If the value of Sign is RWDecimalFormat::BOTH, the attribute value for formatting both positive and negative numbers is set. See the Attributes section to learn how each attribute affects formatting.
This function sets the attribute associated with this formatter object. If the Sign parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is set. If the Sign parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is set. If the value of Sign is RWDecimalFormat::BOTH, the attribute value for formatting both positive and negative numbers is set. See the Attributes section to learn how each attribute affects formatting.
This function sets the attribute associated with this formatter object. If the Sign parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is set. If the Sign parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is set. If the value of Sign is RWDecimalFormat::BOTH, the attribute value for formatting both positive and negative numbers is set. See the Attributes section to learn how each attribute affects formatting.
This function sets the attribute associated with this formatter object. If the Sign parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is set. If the Sign parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is set. If the value of Sign is RWDecimalFormat::BOTH, the attribute value for formatting both positive and negative numbers is set. See the Attributes section to learn how each attribute affects formatting.
bool RWDecimalFormat::showDecimalPoint | ( | Sign | ) | const |
This function returns the current value of the indicated attribute. If the Sign
parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is returned. If the Sign
parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is returned. If the value of Sign
is RWDecimalFormat::BOTH and the attribute values for formatting positive and negative values are different, an exception is thrown. Otherwise, the common value is returned. See the Attributes section for details on how each attribute affects formatting.
unsigned RWDecimalFormat::width | ( | Sign | ) | const |
This function returns the current value of the indicated attribute. If the Sign
parameter is RWDecimalFormat::POSITIVE, the attribute value for formatting positive numbers is returned. If the Sign
parameter is RWDecimalFormat::NEGATIVE, the attribute value for formatting negative numbers is returned. If the value of Sign
is RWDecimalFormat::BOTH and the attribute values for formatting positive and negative values are different, an exception is thrown. Otherwise, the common value is returned. See the Attributes section for details on how each attribute affects formatting.
|
friend |
Formats the number using the format indicated and returns a string. Since there is an automatic type conversion from char*
to RWDecimalFormat you can use this operator in expressions such as:
Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |