As I've been using a method to convert strings into ##,## format, I can't help but wonder if there's an easier way to achieve the same result. Any suggestions?
return new Intl.NumberFormat('de-DE', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
.format(Number(value.replace(',', '.')));
For instance, I'm looking for the following actual and desired formats:
1 --> 1,00
12 --> 12,00
12,3 --> 12,30
12,34 --> 12,34