You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Decimal adjustment of a number.
Describe the solution you'd like
Possible implementation
/** * Decimal adjustment of a number. * * @param {String} type The type of adjustment. * @param {Integer} exp The exponent (the 10 logarithm of the adjustment base). * @param {Number} value The number. * @returns {Number} The adjusted value. */functiondecimalAdjust(type,exp,value){// If the exp is undefined or zero...if(typeofexp==='undefined'||+exp===0){returnMath[type](value);}value=+value;exp=+exp;// If the value is not a number or the exp is not an integer...if(isNaN(value)||!(typeofexp==='number'&&exp%1===0)){returnNaN;}// Shiftvalue=value.toString().split('e');value=Math[type](+(value[0]+'e'+(value[1] ? (+value[1]-exp) : -exp)));// Shift backvalue=value.toString().split('e');return+(value[0]+'e'+(value[1] ? (+value[1]+exp) : exp));}
Is your feature request related to a problem? Please describe.
Decimal adjustment of a number.
Describe the solution you'd like
Possible implementation
Describe alternatives you've considered
--
Additional context
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor#Decimal_adjustment
The text was updated successfully, but these errors were encountered: