Welcome, Guest
Username: Password: Remember me

TOPIC: Remove decimal

Remove decimal 4 years 1 month ago #2657

I would like to remove the decimal in the price, anyone can help me?

maybe changing some here?

{ root } / components / com_jomclassifieds / views / advert / tmpl / default.php

{ root } / components / com_jomclassifieds / views / default / tmpl / default_list.php

{ root } / components / com_jomclassifieds / views / default / tmpl / default_grid.php

{ root } / modules / mod_jomclassifieds_adverts / tmpl / default.php

In the above files search the below line

$price = number_format($item->price, 2) . ' ' . $this->config->currency;

and replace it by below lines

$price = number_format($item->price, 2);
$price = str_replace(",", " ", $price);
$price = str_replace(".", ",", $price);
$price = $price . ' ' . $this->config->currency;
The administrator has disabled public write access.

Remove decimal 4 years 1 month ago #2659

  • Super User
  • Super User's Avatar
  • Offline
  • Administrator
  • Posts: 2941
  • Thank you received: 335
  • Karma: 45
Remove the ",2" from the below function.

$price = number_format($item->price, 2);
$price = str_replace(",", " ", $price);
$price = str_replace(".", ",", $price);
$price = $price . ' ' . $this->config->currency;

Thanks.
The administrator has disabled public write access.
The following user(s) said Thank You: Gabriel Sastre, Conny Fornbäck

Remove decimal 3 years 6 months ago #4458

Hello. My English is not good. I'm sorry.
I need to change the thousands separator for the price. E.g. 15,000 USD. I need it to display 15.000 USD or 15 000 USD. Then I need to change a comma. Advise anyone?
The administrator has disabled public write access.

Remove decimal 3 years 6 months ago #4465

  • Super User
  • Super User's Avatar
  • Offline
  • Administrator
  • Posts: 2941
  • Thank you received: 335
  • Karma: 45
Hi,

Please check the forum link to do it.

jomclassifieds.com/forum/site-configurat...ount-format.html#766

Thanks.
The administrator has disabled public write access.

Remove decimal 2 years 7 months ago #5978

I want remove 2 digit ,00 in price
The administrator has disabled public write access.

Remove decimal 2 years 7 months ago #5987

  • Super User
  • Super User's Avatar
  • Offline
  • Administrator
  • Posts: 2941
  • Thank you received: 335
  • Karma: 45
Hi,

Kindly open the below files,
{ root } / components / com_jomclassifieds / views / advert / tmpl / default.php

{ root } / components / com_jomclassifieds / views / default / tmpl / default_list.php

{ root } / components / com_jomclassifieds / views / default / tmpl / default_grid.php

{ root } / modules / mod_jomclassifieds_adverts / tmpl / default.php


And and "0" instead of ",2" in the below code.
$price = number_format($item->price, 2);
$price = str_replace(",", " ", $price);
$price = str_replace(".", ",", $price);
$price = $price . ' ' . $this->config->currency;

Thanks.
Last Edit: 2 years 1 month ago by Super User. Reason: Change in the solution
The administrator has disabled public write access.
Time to create page: 0.241 seconds

Contact us

  No.2/A, Venkateshwara Nagar,
1st Main Road, 100 Feet Road, SBM Towers, Velachery,Chennai - 600 042,India.
 skype.jomclassifieds
 
 
Copyright © 2013-2018 Jomclassifieds.com. All rights reserved. The Joomla! name, and logo are used under a limited license granted in the United States and other countries.

We accept cookies to provide you the best viewing experience. By using our services, you agree to our use of cookies