I want to format numbers to currency format and I'm trying as follows. I present two examples:
var numero = 1274.78;
var numero1 = 12740.78;
var myObj = {
style: "currency",
currency: "EUR"
}
console.log(numero.toLocaleString("pt-PT", myObj));
console.log(numero1.toLocaleString("pt-PT", myObj));
In the second example it correctly formats the number, but in the first example it doesn't.
As you already have thousands of thousands, you should format the number as follows 1 274.78 € and not as you are formatting it.

1274,78is the expected format for the Portugese locale. If you want1 274,78, try using thefr-FRlocale.