How to convert the result of a multiplication within a string
to display as Real?
The value of bol.ValorBoleto
is loaded a little earlier.
Data annotation : [DisplayFormat(ApplyFormatInEditMode = false, DataFormatString = "{0:c}")]
does not work.
I tried different ways and I could not.
My code looks like this:
[Display(Name = "IRPJ")]
[ReadOnly(true)]
[DisplayFormat(ApplyFormatInEditMode = false, DataFormatString = "{0:c}")]
public string IRPJ { get; set; }
public BoletoBancario GerarBoletoBradesco(BoletoModel bol, string txtIrpj)
{
decimal irpj;
irpj = Convert.ToDecimal(txtIrpj);
bol.IRPJ = "IRPJ " + irpj + "%" + " - " + Convert.ToString(bol.ValorBoleto * irpj);
Instrucao objInst3 = new Instrucao(237);
objInst3.Descricao = bol.IRPJ;
}