OS Property support center

SOLVED !!! Price decimals

  • Dragan
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
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
Last edit: 10 years 1 month ago by Mr. Dam.

Please Log in or Create an account to join the conversation.

More
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
The following user(s) said Thank You: connorlong, Dragan

Please Log in or Create an account to join the conversation.

More
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

Please Log in or Create an account to join the conversation.

More
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

Please Log in or Create an account to join the conversation.

Moderators: Mr. DamNguyen Phu Quan