Limiting woocommerce line_total decimal length
Just round the decimal to two digit as per your requirement. $myID = 2859; $myorder = new WC_Order($myID); foreach ($myorder->get_items(‘line_item’) as $item) { $rounded_total = round($item[“line_total”],2);// allow 2 decimal and avoid further $Data = $Data.OrderLine($item[“name”], $rounded_total, $item[“line_tax”], $item[“qty”], “piece”, “x”); }