Post by aghafarokh » Mon Dec 18, 2017 9:15 am

Hi
i'm using 2.3.0.2
all of my products prices are round
and now i want to remove the 00 decimals that showing on my every products price
please guide me

Newbie

Posts

Joined
Mon Nov 27, 2017 11:19 pm

Post by sachin6609 » Mon Dec 18, 2017 7:23 pm

aghafarokh wrote:
Mon Dec 18, 2017 9:15 am
Hi
i'm using 2.3.0.2
all of my products prices are round
and now i want to remove the 00 decimals that showing on my every products price
please guide me
Use The php number formate function

https://www.w3schools.com/php/func_stri ... format.asp

Thanks

Active Member

Posts

Joined
Thu Jul 23, 2015 2:57 pm

User avatar
Guru Member
Online

Posts

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

Post by aghafarokh » Mon Dec 18, 2017 10:02 pm

paulfeakins wrote:
Mon Dec 18, 2017 8:39 pm
There's a great solution here:
http://www.opencart.com/forum/viewtopic ... 20&t=91498
it's not working
:-\ :-\ :-\ :-\

Newbie

Posts

Joined
Mon Nov 27, 2017 11:19 pm

Post by aghafarokh » Mon Dec 18, 2017 10:11 pm

i'm really tired
i've search all of this forum and try everything
it's not working
when i edit one product and remove the decimal (.00000) from its product and save it
when i refresh the page for the first time all product prices are good without decimal BUT when i refresh it again
those price decimals (.000000) coming baaaacccccckkkkkks

Newbie

Posts

Joined
Mon Nov 27, 2017 11:19 pm

Post by sachin6609 » Tue Dec 19, 2017 2:32 pm

aghafarokh wrote:
Mon Dec 18, 2017 10:11 pm
i'm really tired
i've search all of this forum and try everything
it's not working
when i edit one product and remove the decimal (.00000) from its product and save it
when i refresh the page for the first time all product prices are good without decimal BUT when i refresh it again
those price decimals (.000000) coming baaaacccccckkkkkks
which opencart vserion you are using let me know also the site url please

on which page you want to do this

so i can help you

Thanks

Sachin

Active Member

Posts

Joined
Thu Jul 23, 2015 2:57 pm

Post by rgbrewer » Wed Dec 20, 2017 3:08 am

The database itself is designed to hold a number with four decimal places, and if you give it a whole number like 123, the database still stores 123.0000

The OC code then grabs that 123.0000 number and formats it to the appropriate human-readable currency via the currency library in the system folder... so 123.000 becomes $123.00

You could edit your currency library such that it only returns the numbers before the decimal place.

This is a very simple change for an OC developer, and I'd be surprised if there werent any mods that already do it for you.

New member

Posts

Joined
Sat Apr 22, 2017 9:30 am

Post by Leutzu » Tue Jun 02, 2020 10:57 pm

Settings -> Localisation -> Currencies. Locate the currency of your store (ex. USD) and click the Edit button on the righ (pencil symbol). Under decimal places you probably have 2. Change it 0 then Save. Check a product page in your browser (refresh the browser if you already had it open). It should show the price without the decimals.

Newbie

Posts

Joined
Fri Jul 19, 2019 10:52 pm
Who is online

Users browsing this forum: No registered users and 198 guests