I want to make a function to add 2 currency with string format and dynamic by language code. something like this
function addCurrecy(c1, c2, lang) {
/* */
return c
}
console.log(addCurrecy('3.319,00 €', '100,00 €', 'de-DE')) // '3.419,00 €'
console.log(addCurrecy('CHF 1’719.90', 'CHF 100.00', 'de-CH')) // 'CHF 1’819.90'
The Intl.NumberFormat() can help me format the number, but I get stuck at plus number. Any suggestion guys?