Post by mikrocica » Wed May 03, 2023 5:31 pm

Hi, can anyone pls tell me if and how I can set weight decimal from "1.00000000" to "1"
I need 1 kg to be shown, no point, no zero no any number afterwards
Thank you in advance for any help.

Newbie

Posts

Joined
Tue Jun 02, 2015 3:30 pm

Post by paulfeakins » Wed May 03, 2023 7:11 pm

mikrocica wrote:
Wed May 03, 2023 5:31 pm
Hi, can anyone pls tell me if and how I can set weight decimal from "1.00000000" to "1"
I need 1 kg to be shown, no point, no zero no any number afterwards
Thank you in advance for any help.
Well you'd better give us a lot more information such as what theme you're using, what extensions, where is this number showing, and maybe a link to your site?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by Dutch Pride Code » Sat May 06, 2023 1:25 am

mikrocica wrote:
Wed May 03, 2023 5:31 pm
Hi, can anyone pls tell me if and how I can set weight decimal from "1.00000000" to "1"
I need 1 kg to be shown, no point, no zero no any number afterwards
Thank you in advance for any help.
Do you mean for products?

You can't remove decimals but they don't affect whether it's grams or kilograms either. If you want to set the weight of a product you enter a decimal number (1.00000000 means it's 1) and then you set what weight unit it uses. You do this at the dropdown right below the decimal number you entered.

If there's no suitable weight units there, you can add weight units under System > Localisation > Weight class - For kilograms you set the 'value' of that weight unit to 1000.00000000 which means one kilogram is 1000 times the default weight unit (grams).

Changing the way that weight number displays requires custom work. Pretty sure there's a nice developer out here willing to help you out with that. If you're trying to display the number yourself using PHP, you can use the PHP number_format() method to change the way the number displays.

User avatar
Active Member

Posts

Joined
Sun Jan 26, 2020 9:46 pm
Who is online

Users browsing this forum: No registered users and 14 guests