An object for formatting numbers in a rate format.
Description
RateFormatis the IRateFormatinterface coclass who's members determine how the ValueToStringmethod in the associated INumberFormatinterface formats numeric values accoring to a given rate factor and string suffix.
RateFormatalso inherits the INumericFormatinterface, so both these interface's properties determine how numbers are formatted.
Supported Platforms
Windows, Solaris, Linux
Interfaces
Interfaces | Description |
---|---|
IClone | Provides access to members that control cloning of objects. |
INumberFormat | Provides access to members that format numbers. |
INumberFormatOperations | Provides access to common operations on formatted numbers. |
INumericFormat | Provides access to members that format numbers. |
IPersist | |
IPersistStream | |
IRateFormat | Provides access to members that format rates. |
Remarks
RateString and RateFactor determine how the formatting takes place when using the ValueToString and StringToValue methods of the associated INumberFormat interface.
When using the ValueToString method, any string defined in the RateString property (the default value is Null) is appended to the method�s input value. Also, the value in the RateFactor property (the default value is 1000) is divided into the ValueToString argument value. For example, ValueToString (300) with a RateFactor of 3 and a RateString of �loaves� would return a formatted string of �100 loaves�.
The corresponding StringToValue method also uses both these properties. The value from the input string is multiplied by the value in the RateFactor property when StringToValue converts the number back. Also, if set, the RateString is stripped from the result. To obtain the numerical value that was used as an argument to the ValueToString method, make sure the RateFactor property is the same as it was when the ValueToString****method was originally used.