I've created a function that removes all zero values... How can I modify it to also delete 0 with a plus or minus sign? Currently, only +0 values are being removed. What should I add to my RegEx?
Here's my current code:
// Transform values
public transformAmount(val: number) {
// console.log('Value', val, val.toLocaleString('de-DE', { maximumFractionDigits: 0 }));
return val.toLocaleString('de-DE', { maximumFractionDigits: 0 }).replace(/^-0+/, '');
}