I have a cart price where I have to split items into multiple checks and want to divide quantity by the split and but show the fraction number into ratio for the end user.
Here is the example code.
$product = 'Cheese Pizza';
$quantity = 1;
$split = 3;
There are 3 checks and each check should have the number like below
// Check 1
1/3 Cheese Pizza (the quantity is stored in the database is .33)
I was trying this by the following code.
$product_name = $quantity."/".$split" ".$product;
However if I have quantity divided into let's say 3, I have fraction in the quantity.
So it looks like I need fraction to ratio. Any ideas?