- Posts: 20
- Thank you received: 0
OS Property support center
SOLVED !!! Price decimals
- Dragan
- Topic Author
- Offline
- Junior Member
-
Less
More
10 years 1 month ago - 10 years 1 month ago #60865
by Dragan
SOLVED !!! Price decimals was created by Dragan
Hello guys,
I would like to remove the price decimals if they are zeros.
It's little bit confusing if you see the price like that € 300 000,00.
It would bi nicer and easier to read € 300 000.
Any idea?
Thanks,
Regards,
Drag
I would like to remove the price decimals if they are zeros.
It's little bit confusing if you see the price like that € 300 000,00.
It would bi nicer and easier to read € 300 000.
Any idea?
Thanks,
Regards,
Drag
Last edit: 10 years 1 month ago by Mr. Dam.
Please Log in or Create an account to join the conversation.
- Mr. Dam
-
- Offline
- Administrator
-
Less
More
- Posts: 13056
- Thank you received: 1696
10 years 1 month ago #60896
by Mr. Dam
Replied by Mr. Dam on topic Price decimals
Hi,
To remove zero after separator, please follow these steps
1. Open file: components > com_osproperty > helpers > common.php
find
case "1":
return number_format($price,2,',','.');
break;
case "2":
return number_format($price,2,',',' ');
break;
case "3":
return number_format($price,2,'.',',');
break;
case "4":
return number_format($price,0,',','.');
break;
case "5":
return number_format($price,0,',',' ');
break;
case "6":
return number_format($price,0,'.',',');
break;
and replace by
case "1":
return rtrim(rtrim(number_format($price,2,',','.'),'0'),',');
break;
case "2":
return rtrim(rtrim(number_format($price,2,',',' '),'0'),',');
break;
case "3":
return rtrim(rtrim(number_format($price,2,'.',','),'0'),'.');
break;
case "4":
return rtrim(rtrim(number_format($price,0,',','.'),'0'),',');
break;
case "5":
return rtrim(rtrim(number_format($price,0,',',' '),'0'),',');
break;
case "6":
return rtrim(rtrim(number_format($price,0,'.',','),'0'),'.');
break;
Thanks
Dam
To remove zero after separator, please follow these steps
1. Open file: components > com_osproperty > helpers > common.php
find
case "1":
return number_format($price,2,',','.');
break;
case "2":
return number_format($price,2,',',' ');
break;
case "3":
return number_format($price,2,'.',',');
break;
case "4":
return number_format($price,0,',','.');
break;
case "5":
return number_format($price,0,',',' ');
break;
case "6":
return number_format($price,0,'.',',');
break;
and replace by
case "1":
return rtrim(rtrim(number_format($price,2,',','.'),'0'),',');
break;
case "2":
return rtrim(rtrim(number_format($price,2,',',' '),'0'),',');
break;
case "3":
return rtrim(rtrim(number_format($price,2,'.',','),'0'),'.');
break;
case "4":
return rtrim(rtrim(number_format($price,0,',','.'),'0'),',');
break;
case "5":
return rtrim(rtrim(number_format($price,0,',',' '),'0'),',');
break;
case "6":
return rtrim(rtrim(number_format($price,0,'.',','),'0'),'.');
break;
Thanks
Dam
The following user(s) said Thank You: connorlong, Dragan
Please Log in or Create an account to join the conversation.
- Jim
- Offline
- New Member
-
Less
More
- Posts: 19
- Thank you received: 0
10 years 1 month ago #61228
by Jim
Replied by Jim on topic Price decimals
Hi Dam,
what do put if you want the price to look like $515,000
what do put if you want the price to look like $515,000
Please Log in or Create an account to join the conversation.
- Mr. Dam
-
- Offline
- Administrator
-
Less
More
- Posts: 13056
- Thank you received: 1696
10 years 1 month ago #61250
by Mr. Dam
Replied by Mr. Dam on topic Price decimals
Hi Jim,
You can configure the money format at Back-end > OS Property > Configuration > Tab: General > Field: Money format
Thanks
Dam
You can configure the money format at Back-end > OS Property > Configuration > Tab: General > Field: Money format
Thanks
Dam
Please Log in or Create an account to join the conversation.
Moderators: Mr. Dam, Nguyen Phu Quan
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.