mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
react app
This commit is contained in:
23
react-app/node_modules/lodash/internal/createRound.js
generated
vendored
Normal file
23
react-app/node_modules/lodash/internal/createRound.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
/** Native method references. */
|
||||
var pow = Math.pow;
|
||||
|
||||
/**
|
||||
* Creates a `_.ceil`, `_.floor`, or `_.round` function.
|
||||
*
|
||||
* @private
|
||||
* @param {string} methodName The name of the `Math` method to use when rounding.
|
||||
* @returns {Function} Returns the new round function.
|
||||
*/
|
||||
function createRound(methodName) {
|
||||
var func = Math[methodName];
|
||||
return function(number, precision) {
|
||||
precision = precision === undefined ? 0 : (+precision || 0);
|
||||
if (precision) {
|
||||
precision = pow(10, precision);
|
||||
return func(number * precision) / precision;
|
||||
}
|
||||
return func(number);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = createRound;
|
Reference in New Issue
Block a user