0
I own a property montante
in the object below, and I am presenting in the function escreverNaTela()
:
class Objeto{
constructor(private montante: number){}
escreverNaTela(){
let mensagem = 'R$ ' + this.montante;
console.log(mensagem);
}
}
However, when writing on the screen, if the value of montante
is an integer the value will not appear with the two decimal places after the comma, as usual. How can I convert the string to that value montante
so that it has these 2 decimal places after the comma?
But it’s not just using toLocaleString() ?
– LeAndrade
That’s right, thank you
– Arthur Siqueira