0
Good staff, I have a system for issuing electronic invoice, there is a government rule where the values of duplicates(installments) must possess exact 2 decimal places. I use number_format to declare that it shows only two decimal places, but when the number is an integer decimal it does not show a zero, example:
Installment 1 : R$ 140,11 Installment 2: R$ 140,10
What happens is that when shows the plot 2 it shows me R $ 140,1 , IE, eats a zero, someone would know me how to add this zero when it happens this case?
I use it to show two decimal places:
number_format($calcula_duplicata, 2, '.', '');
Are you sure? Here returned 140.10 even...
– Woss
I made in my localhost its exact code and the return was
140.10
– David Alves
Yes, I’ve noticed that, the problem is that in what generates the xml it eats this zero
– Nicholas Ruschel Krüger
I wanted something that identified the amount of decimals it has and if it equals 1 add a zero
– Nicholas Ruschel Krüger
But is it exactly the same code? Can you elaborate a [mcve]?
– Woss
But this php code you put in the question already does this Nicholas.
– David Alves