- Posts: 8
- Thank you received: 0
control the display of prices fractional part
14 years 2 weeks ago #65985
by 8stinger8
control the display of prices fractional part was created by 8stinger8
I want to display price like that $9.99 (if price = $9.99)
and like that $10 (if price = $10.00)
i.e. if price has fractional part, then display fractional part
if not, then doesn't display fractional part
and like that $10 (if price = $10.00)
i.e. if price has fractional part, then display fractional part
if not, then doesn't display fractional part
Please Log in or Create an account to join the conversation.
14 years 2 weeks ago #65993
by nicolas
Replied by nicolas on topic Re: control the display of prices fractional part
There is no option for that.
You would have to edit all the views where prices are displayed and change the display code to strip the cents display if it's 00.
For example, in the "listing_price" view file that you can edit via the menu Display->Views, you have these sort of lines:
echo $this->currencyHelper->format($price->price_value_with_tax,$price->price_currency_id);
and you should change them to:
echo str_replace('.00','',$this->currencyHelper->format($price->price_value_with_tax,$price->price_currency_id));
You would have to edit all the views where prices are displayed and change the display code to strip the cents display if it's 00.
For example, in the "listing_price" view file that you can edit via the menu Display->Views, you have these sort of lines:
echo $this->currencyHelper->format($price->price_value_with_tax,$price->price_currency_id);
and you should change them to:
echo str_replace('.00','',$this->currencyHelper->format($price->price_value_with_tax,$price->price_currency_id));
Please Log in or Create an account to join the conversation.
Time to create page: 0.159 seconds