Provides access to members that format rates.
Description
The members in the **IRateFormat**interface define how the ValueToStringmethod in the associated INumberFormat****interface formats numbers.
The RateFormatcoclass also inherits the INumericFormat****interface, so both these interface's properties determine how numbers are formatted.
When To Use
Use the IRateFormatinterface to format numeric values according to a given rate factor.
Members
Name | Description | |
---|---|---|
RateFactor | The rate factor applied to the ValueToSring and StringToValue methods. | |
RateString | The label appended to the formatted rate number. |
IRateFormat.RateFactor Property
The rate factor applied to the ValueToSring and StringToValue methods.
Public Property RateFactor As Double
public double RateFactor {get; set;}
Description
The RateFactor property sets or returns a value (default: 1000) that is used as a _divisor_in the ValueToString method and as a _multiplier_in the StringToValue****method in the associated INumberFormat interface.
IRateFormat.RateString Property
The label appended to the formatted rate number.
Public Property RateString As String
public string RateString {get; set;}
Description
The RateString property sets or returns a string value (default: null) that is appended to the formatted output returned from the ValueToString method in the associated INumberFormat interface. The StringToValue**method strips the RateString** out and returns only the numerical value.
Classes that implement IRateFormat
Classes | Description |
---|---|
RateFormat | An object for formatting numbers in a rate format. |
Remarks
The string defined in the RateStringproperty is appended to the format returned from the ValueToString****method.
The value in the RateFactorproperty is _divided_into the ValueToStringargument value. For example, ValueToString(300)with a RateFactorof 3returns a formatted string of 100. The corresponding StringToValue**method also uses this property. The value in its argument is _multiplied_by the value in the RateFactorproperty when StringToValueconverts the number back. To obtain the numerical value that was used as an argument to the ValueToStringmethod, make sure the RateFactorproperty is the same as it was when the ValueToString**method was originally used.