shuffle( [1, 2, 3, 4, 5, 6, 7, 8, 9], 5 ) +DIGITS.join( "" ) randFromArray([ -2, -3 ]) numberPlaceNames[-PLACE] plural_form(numberPlaceNames[-PLACE - 1], 2) Math.round(roundTo( PLACE, NUM )) DIGITS[5 + PLACE]

Round `NUM` to the nearest TPLACE.

ROUNDED
randFromArray([ -2, -3 ]) (function() { var digits = shuffle( [1, 2, 3, 4, 6, 7, 8, 9], 5 ); digits[ 5 + PLACE ] = 5; return digits; })() +DIGITS.join( "" ) numberPlaceNames[-PLACE] plural_form(numberPlaceNames[-PLACE - 1], 2) roundTo( PLACE, NUM ) 5

Round `NUM` to the nearest TPLACE.

ROUNDED

Because we want to round to the plural_form(TPLACE, 2) place, we need to look at the digit in the TPLACES place.

The digit in the TPLACES place is `KEYDIGIT`.

Because `KEYDIGIT` is more than `5`, we round up to `ROUNDED`.

Because the TPLACES place digit is `KEYDIGIT`, we round up to `ROUNDED`.

Because `KEYDIGIT` is less than `5`, we round down to `ROUNDED`.