Class Rate
A wrapper class for a double representing a rate.
The class has methods to format the rate as percentage or per mille.
Methods summary
public
|
|
public static
|
|
public
|
|
public
string
|
#
percent( integer $decimals )
Formats the rate as percentage with $decimals number of decimals.
Formats the rate as percentage with $decimals number of decimals.
Parameters
- $decimals
- number of decimals to use when the rate is formatted.
Returns
string The rate formatted as percentage. Example: 15.4 %
|
public
string
|
#
perMille( integer $decimals )
Formats the rate as per mille with {@code decimals} number of decimals.
Formats the rate as per mille with {@code decimals} number of decimals.
Parameters
- $decimals
- number of decimals to use when the rate is formatted.
Returns
string The rate formatted as per mille. Example: 7.25 ‰
|
public
float
|
#
value( )
Returns
float The rate in decimal form.
|