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

Post by paulfeakins » Mon Dec 18, 2017 8:39 pm


For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, 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
Who is online

Users browsing this forum: Baidu [Spider] and 30 guests