这是我的代码:
$no=1;
while($item = mysqli_fetch_array($query)){
$pdf->Cell(10 ,5,$no++,1,0);
$pdf->Cell(100 ,5,$item['naran'],1,0);
//add thousand separator using number_format function
$pdf->Cell(25 ,5,number_format ( $item['folin_faan']),1,0);
$pdf->Cell(25 ,5,number_format( $item['hamutuk']),1,0);
$pdf->Cell(34 ,5,number_format( $item['total']),1,1,'R');//end of line
//accumulate tax and amount
$tax += $item['hamutuk'];
$total += $item['total'];
}
它应该像0.00
一样显示十进制值
我想要显示十进制值的列:
问:如何准确地显示十进制值?
发布于 2019-10-10 22:12:35
您可以使用以下代码:
$this->Cell(30,20,"C$ ".number_format($data->precio_venta,2,'.',','),1,0,'L');
如果需要数千,结果将是C$ 2,500.00
;如果需要数百,结果将是C$ 450.00
。
https://stackoverflow.com/questions/51603583
复制相似问题