VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: serazoo on December 27, 2020, 17:15:46 PM

Title: Please don't strip my zeros!
Post by: serazoo on December 27, 2020, 17:15:46 PM
Hello VM community :)

I'm using Joomla 3.9.23 and VirtueMart 3.8.6 10373
I'm sure this not a bug but can this be modified?

I'm using a php report that pulls virtuemart info directly form database
In product "Cost price", "Base price" or "Final price", I would like them to keep the .00 decimals, they all are stripped away when I save product info
I've checked, unchecked "Show rounded price"... and played with the "price" tab : in rounding values : -1 , or 0  or 2...

My report still gives me :
4$
3,22$
13,5$
190$
8,05$
3,16$

instead of :
4,00$
3,22$
13,50$
190,00$
8,05$
3,16$

Thank you :)


Title: Re: Please don't strip my zeros!
Post by: GJC Web Design on December 27, 2020, 17:35:32 PM
must be your code as the price is stored to 6 figures

try displaying as number_format($price,2);
Title: Re: Please don't strip my zeros!
Post by: Studio 42 on December 28, 2020, 11:49:29 AM
Or use Virtuemart methods to round the price, or use number_format
See https://www.w3schools.com/php/func_string_number_format.asp