Add a zero when there is only 1 decimal

0

Well folks, I have a system for issuing electronic invoices, there is a government rule where the values of the duplicates (parcels) must have exact 2 decimal places. I use the number_format to declare it to show only two decimal places, but when the number is an integer decimal it does not show a zero, eg

Plot 1: R $ 140.11 Plot 2: R $ 140.10

What happens is that when it shows plot 2 it shows me $ 140.1, that is, it eats a zero, someone would know how to add that zero when this case happens?

I use this to display two decimal places:

number_format($calcula_duplicata, 2, '.', '');
    
asked by anonymous 02.08.2018 / 15:53

0 answers