Express fraction( _N, _D )
as a decimal.
fraction( _N, _D )
reduces to fraction( N, D )
.
Denominators of 10 or 100 are easy cases: The decimal form is just the numerator with the decimal place moved left by the number of 0s in the denominator.
For this question, this means D === 10 ? "1 place" : "2 places".
To turn fractionSmall( N, D )
into a decimal, perform long division, dividing D
into N
(if you need help with this, try practicing some Division exercises or watching some related videos).
N \div D = DEC