Converts a decimal number to a fractional dollar number, such as a securities price.
Remarks:
fraction
0
A decimal number.
The integer to use in the denominator of the fraction.
the converted dollar price expressed as a fractional dollar number
dollarfr(1.125, 16); // 1.02 Copy
dollarfr(1.125, 16); // 1.02
Converts a decimal number to a fractional dollar number, such as a securities price.
Remarks:
fractionis not an integer, it is truncated.fractionis less than0, this function will throw a RangeError.fractionis0, division by zero is impossible and this function will throw a RangeError.