Welcome, Guest
Username: Password: Remember me

TOPIC: Remove decimal

Remove decimal 2 years 6 months 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 2 years 6 months ago #2659

  • Super User
  • Super User's Avatar
  • Offline
  • Administrator
  • Posts: 2760
  • Thank you received: 292
  • Karma: 40
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 2 years 2 weeks 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 2 years 2 weeks ago #4465

  • Super User
  • Super User's Avatar
  • Offline
  • Administrator
  • Posts: 2760
  • Thank you received: 292
  • Karma: 40
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 1 year 1 month ago #5978

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

Remove decimal 1 year 1 month ago #5987

  • Super User
  • Super User's Avatar
  • Offline
  • Administrator
  • Posts: 2760
  • Thank you received: 292
  • Karma: 40
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: 7 months 1 week ago by Super User. Reason: Change in the solution
The administrator has disabled public write access.
Time to create page: 0.622 seconds