Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getFormated(value, format, sign = '', dec = 2) {
if (format === 'fullPrice') {
return `${sign}${numberWithSpaces(value.toFixed(dec))}`;
}
if (format === 'formatter') {
return formatter(value, sign);
}
return `${sign}${numberWithSpaces(toShort(value))}`;
}