How many times do you need to multiply localeToFixed(A_FLOAT, A_DECIMAL)
by ten to get localeToFixed(B_FLOAT, B_DECIMAL)
?
How many times do you need to divide localeToFixed(A_FLOAT, A_DECIMAL)
by ten to get localeToFixed(B_FLOAT, B_DECIMAL)
?
POW_DIFF
Moving the decimal one position to the right is the same as multiplying by ten once.
Moving the decimal one position to the left is the same as dividing by ten once.
Thus, moving the decimal right POW_DIFF
times is the same as multiplying by ten POW_DIFF
times, or multiplying by pow( 10, POW_DIFF )
:
{localeToFixed(A_FLOAT, A_DECIMAL)} * {pow( 10, POW_DIFF )} = {localeToFixed(B_FLOAT, B_DECIMAL)}
Thus, moving the decimal left POW_DIFF
times is the same as dividing by ten POW_DIFF
times, or dividing by pow( 10, POW_DIFF )
:
{localeToFixed(A_FLOAT, A_DECIMAL)} \div {pow( 10, POW_DIFF )} = {localeToFixed(B_FLOAT, B_DECIMAL)}
You need to multiply by ten POW_DIFF
time.
You need to multiply by ten POW_DIFF
times.
You need to divide by ten POW_DIFF
time.
You need to divide by ten POW_DIFF
times.