randRange(1, 99) integerToDigits(NUMERATOR) _.map(DIGITS, function(d, i) { return d * pow(10, DIGITS.length - 1 - i); }) randRange(1, 2) pow(10, PLACES) (function() { var digits = []; var colors = ["blue", "pink"]; var n = 0; for (var i = 0; i < 3; i++) { if (VALUES[n] && VALUES[n] >= pow(10, PLACES - i)) { digits.push("\\" + colors[n] + "{" + DIGITS[n++] + "}"); } else { digits.push(0); } } return digits; })() roundTo(3, NUMERATOR / DENOMINATOR)

Express \dfrac{NUMERATOR}{DENOMINATOR} as a decimal.

SOLUTION

\dfrac{NUMERATOR}{DENOMINATOR} = \blue{\dfrac{VALUES[0]}{DENOMINATOR}} + \pink{\dfrac{VALUES[1]}{DENOMINATOR}}

\phantom{\dfrac{NUMERATOR}{DENOMINATOR}} = \blue{\dfrac{DIGITS[0]}{DENOMINATOR / 10}} + \pink{\dfrac{DIGITS[1]}{DENOMINATOR}}

\phantom{\dfrac{NUMERATOR}{DENOMINATOR}} = \blue{DIGITS[0] \text{ plural_form(decimalPlaceNames[PLACES - 1], DIGITS[0])}} + \pink{DIGITS[1] \text{ plural_form(decimalPlaceNames[PLACES], DIGITS[1])}}

\dfrac{NUMERATOR}{DENOMINATOR} = \blue{DIGITS[0] \text{ plural_form(decimalPlaceNames[PLACES], DIGITS[0])}}

We can use a place value chart to help us write a decimal.

Ones . Tenths Hundredths
DECIMAL_DIGITS[0] . DECIMAL_DIGITS[1] DECIMAL_DIGITS[2]

\dfrac{NUMERATOR}{DENOMINATOR} = SOLUTION