task/02-numbers-tasks.js
/**
 * Returns the number rounded to specified power of 10.
 *
 * @param {number} num
 * @param {number} pow
 * @return {number}
 *  
 * @example:
 *   1234, 0  => 1234
 *   1234, 1  => 1230
 *   1234, 2  => 1200
 *   1234, 3  => 1000
 *   1678, 0  => 1678
 *   1678, 1  => 1680
 *   1678, 2  => 1700
 *   1678, 3  => 2000
 */
Returns the number rounded to specified power of 10.


Returns the number rounded to specified power of 10 .
function roundToPowerOfTen(num, pow) {
    let a = num;
    let b = pow;
    let c = Math.pow(10, b);
    let d = a / c;
    d = Math.round(d);
    d = d * c;
    return d;
}
function roundToPowerOfTen ( num , pow ) { let a = num ; let b = pow ; let c = Math . pow ( 10 , b ) ; let d = a / c ; d = Math . round ( d ) ; d = d * c ; return d ; }
Returns the number rounded to specified power of 10.
Returns the number rounded to specified power of 10 .