I'm not sure if I did this right now that I'm trying to get part of my text field to show up as a decimal, but here's the details:
table orders
field cart - text datatype
cart field lists products ordered from the mals-e shopping cart, which means products are parsed with a "~", and the description, quantity, price, and units are parsed with a ":"
I created a page that lists general order information, and links to a page displaying detailed order info. On the detailed info page, I list the product, quantity, and price of each item ordered. I used str_replace() to parse the data so it would spread across the rows in a table.
My problem is that the data entered into the cart is missing the 0s that would be there if the field was a decimal datatype! The amounts are showing up as 2.5 instead of 2.50. I would also like to not have the units show up, instead of showing them as 0, but I can deal with that.
Is there a way I can maybe separate the data in each row into a separate array and assign a datatype - or is there something I'm missing? I have no clue how to make this work - and I'm new at this. Any help would be greatly appreciated.
Thanks.