Discussions

Stock - why decimals ? how to show only int

Hi.

product shows stock as 1.00 -> how do i get it to show 1
(i get this to work in admin lists : admin/commerce/product
but when showing in start screen or product detail page its 1.00..

also how to get stock to show in the product list page. (only shows in the the detail page)

Thanks.

Posted: Sep 6, 2012

Comments

iandickson ian on August 6, 2013

When adding a Stock field, it defaults to decimal of the form 8.00.

Set the Field Settings so that there are 0 to the right of the Decimal point. However it will still display as 8.00.
To get rid of that, set the Display to Unformatted.

Note - this must be done before creating any products. Once you create products the Field Settings get locked.