- Posts: 59
- Thank you received: 0
rounded price
13 years 6 months ago #95872
by Dodesign
rounded price was created by Dodesign
hi.
how can i round price? if, for example, price 4567$ need to display like 4600$? how it's possible?
how can i round price? if, for example, price 4567$ need to display like 4600$? how it's possible?
Please Log in or Create an account to join the conversation.
13 years 6 months ago #95903
by nicolas
Replied by nicolas on topic rounded price
Hi,
There is no such option as far as I can see.
Why not directly enter the price of 4600$ in your product price ?
There is no such option as far as I can see.
Why not directly enter the price of 4600$ in your product price ?
Please Log in or Create an account to join the conversation.
13 years 6 months ago #95940
by Dodesign
Replied by Dodesign on topic rounded price
Oh. Main currency is $, secondary is BYR. When user enter price in $, it converted into BYR with scale 1:8750, for example, and price can be 856650 BYR, I want round it.
Please Log in or Create an account to join the conversation.
13 years 6 months ago #95942
by nicolas
Replied by nicolas on topic rounded price
I've did some tests and I think I have a solution to what you need.
Edit your BYR currency via the menu System>Currencies and change the local and international fractional digits options to -1 or -2 or -3 based on the precision of the rounding you want and in the administrator/components/com_hikashop/classes/currency.php, change the code:
to:
That should do what you need hopefully.
Edit your BYR currency via the menu System>Currencies and change the local and international fractional digits options to -1 or -2 or -3 based on the precision of the rounding you want and in the administrator/components/com_hikashop/classes/currency.php, change the code:
Code:
$num = sprintf("%0.{$decimals}f",round($number,$decimals));
Code:
if($decimals<0){
$round = 0;
}else{
$round = $decimals;
}
$num = sprintf("%0.{$round}f",round($number,$decimals));
That should do what you need hopefully.
Please Log in or Create an account to join the conversation.
13 years 6 months ago #95961
by Dodesign
Replied by Dodesign on topic rounded price
something didn't work. i do all what you say but it is nothing. how can i display digits after "," like 000? site is
kresloff.by
Please Log in or Create an account to join the conversation.
13 years 6 months ago #96024
by nicolas
Replied by nicolas on topic rounded price
You can't put some digits of prices like that.
What didn't work ? You didn't see any difference ? I tested it on my end and it worked fine...
What didn't work ? You didn't see any difference ? I tested it on my end and it worked fine...
Please Log in or Create an account to join the conversation.
Time to create page: 0.220 seconds