From 24aefba7e31ccf1d9ce111679491827b8e732e8b Mon Sep 17 00:00:00 2001 From: 7u83 <7u83> Date: Mon, 9 Mar 2020 13:36:54 +0000 Subject: [PATCH] Puts amount with 2 decimals into snipped PDFs --- submit.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/submit.php b/submit.php index e3207a0..1b01d0f 100644 --- a/submit.php +++ b/submit.php @@ -236,12 +236,16 @@ function mkSnippedPdf($key){ $amount = $_POST['amount'][$key]; $desc = $_POST['description'][$key]; + $am = floatval(str_replace(",",".",$amount)); + $am = str_replace(".",",",sprintf("%.2f",$am)); + + $html = <<Position $pos

$desc


-

$amount EUR


+

$am EUR


EOD; // Print text using writeHTMLCell()