randFromArray([ 4, 5, 8, 10, 16, 20, 25, 40, 50, 100 ]) randRange( 1, _D - 1 ) _N / _D
getGCD( _N, _D ) round( _N / GCD ) round( _D / GCD )

Express fraction( _N, _D ) as a decimal.

DEC

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