Remove semicolons.

This commit is contained in:
John-David Dalton
2017-02-04 23:50:10 -08:00
parent f3a8e55e70
commit 6cb3460fce
452 changed files with 4261 additions and 4261 deletions

View File

@@ -1,6 +1,6 @@
import toInteger from '../toInteger.js';
import toNumber from '../toNumber.js';
import toString from '../toString.js';
import toInteger from '../toInteger.js'
import toNumber from '../toNumber.js'
import toString from '../toString.js'
/**
* Creates a function like `round`.
@@ -10,21 +10,21 @@ import toString from '../toString.js';
* @returns {Function} Returns the new round function.
*/
function createRound(methodName) {
const func = Math[methodName];
const func = Math[methodName]
return (number, precision) => {
number = toNumber(number);
precision = precision == null ? 0 : Math.min(toInteger(precision), 292);
number = toNumber(number)
precision = precision == null ? 0 : Math.min(toInteger(precision), 292)
if (precision) {
// Shift with exponential notation to avoid floating-point issues.
// See [MDN](https://mdn.io/round#Examples) for more details.
let pair = `${ toString(number) }e`.split('e');
const value = func(`${ pair[0] }e${ +pair[1] + precision }`);
let pair = `${ toString(number) }e`.split('e')
const value = func(`${ pair[0] }e${ +pair[1] + precision }`)
pair = `${ toString(value) }e`.split('e');
return +`${ pair[0] }e${ +pair[1] - precision }`;
pair = `${ toString(value) }e`.split('e')
return +`${ pair[0] }e${ +pair[1] - precision }`
}
return func(number);
};
return func(number)
}
}
export default createRound;
export default createRound