Author Topic: Help removing decimal values from product width  (Read 205 times)

peterbill

  • Beginner
  • *
  • Posts: 1
  • A beginner
  • Skype Name: peter bill
Help removing decimal values from product width
« on: May 06, 2019, 05:08:31 am »
Hi Everyone,

quick question. How do I remove the decimal point from the products height and width? I'm showing the dimensions in millimeters and don't want to show the decimal value. Personally I think it looks really odd showing the decimal place to 4 points.

I've been looking all over the net for answers and can't find anything for VirtueMart 3 and feel that using this forum is my last resort.

thanks!

Ghost

  • Jr. Member
  • **
  • Posts: 422
Re: Help removing decimal values from product width
« Reply #1 on: May 06, 2019, 08:45:21 am »
If you have code like:

Code: [Select]
echo $this->product->product_width;
Just cast value as integer:

Code: [Select]
echo (int) $this->product->product_width;