0

The following string return the value like: 938.173,00 euro. How to obtain the value like: Euro 938.173,00?

formattedValue = value.toLocaleString('it-IT', {currency: 'EUR', currencyDisplay: 'name', style: 'currency'});

Thanks

TheMaster
  • 45,448
  • 6
  • 62
  • 85
  • Welcome. Why [tag:google-apps-script] was included? If you are using Google Apps Script pleas clarify if this is being used on the server side or on the cliente side. Also add a [mcve]. – Rubén Feb 16 '20 at 22:19

1 Answers1

1

There doesn't seem to be any specific options in Intl to custom-prepend the currency. It is done automatically according to your locale. But, you could simply String.replace:

const value = 938173.00
const formattedValue = `euro ${value.toLocaleString('it-IT', {currency: 'EUR', currencyDisplay: 'name', style: 'currency'}).replace(" euro","")}`;
console.info(formattedValue);
TheMaster
  • 45,448
  • 6
  • 62
  • 85