Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function formatUnits(value, unitName) {
if (typeof (unitName) === "string") {
var index = names.indexOf(unitName);
if (index !== -1) {
unitName = 3 * index;
}
}
return fixednumber_1.formatFixed(value, (unitName != null) ? unitName : 18);
}
exports.formatUnits = formatUnits;