Product weight rounding-up

  • Posts: 88
  • Thank you received: 0
13 years 2 weeks ago #29893

Hi,

I've encountered a strange problem with my product weights rounding-up. On the attached images you can see that I'm entering 2.50 kg, but this is displaying as 3 kg on the front end. Any ideas why this might be happening?

Thanks

Darren

Please Log in or Create an account to join the conversation.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
13 years 2 weeks ago #29898

Hi,

There should be no rounding made on weight.

Did you change some of the code in the file "show" of the view "product" ?

Please Log in or Create an account to join the conversation.

  • Posts: 88
  • Thank you received: 0
13 years 2 weeks ago #29902

No, I've not changed any of the code. It only seems to do it when I add a decimal point - 2.5kg appears as 3kg.

Please Log in or Create an account to join the conversation.

  • Posts: 88
  • Thank you received: 0
13 years 2 weeks ago #29903

Hi Nicolas,

Actually, I've changed this on listing_img_title:

Minimum Weight: <?php echo round($this->row->product_weight,0)?><?php echo $this->row->product_weight_unit;?><br>

This removed the zeros after the weight. Is it possible to have only one decimal for exampl 4.2 rather than 4.2000?

Thanks

Darren

Please Log in or Create an account to join the conversation.

  • Posts: 88
  • Thank you received: 0
13 years 2 weeks ago #29907

Hi Nicolas,

It's ok - I've fixed it!

Changed:
Minimum Weight: <?php echo round($this->row->product_weight,0)?><?php echo $this->row->product_weight_unit;?><br>

to:

Minimum Weight: <?php echo round($this->row->product_weight,1)?><?php echo $this->row->product_weight_unit;?><br>

Cheers

Darren

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum