nl_tokens: FUNCTION : roundn ( x n ) Rounds values to the nearest multiple of 10^n . Notes : if provided an array mutates the array .
pl_tokens: function roundn ( x , n ) { var isArray = Array . isArray ( x ) , scalar , len ; if ( ! isArray && ( typeof x !== 'number' || x !== x ) ) { throw new TypeError ( 'roundn()::invalid input argument. Must provide either a single numeric value or a numeric array.' ) ; } if ( typeof n !== 'number' || n !== n || n !== ( n | 0 ) ) { throw new TypeError ( 'roundn()::invalid input argument. Power of 10 must be an integer value.' ) ; } n = - n ; scalar = Math . pow ( 10 , n ) ; if ( ! isArray ) { return Math . <mask> ( x * scalar ) / scalar ; } len = x . length ; if ( ! len ) { return null ; } for ( var i = 0 ; i < len ; i ++ ) { x [ i ] = Math . round ( x [ i ] * scalar ) / scalar ; } return x ; }