How can I resolve the issue with the floor filter in product price code?

Hi all,
I am facing issue with shopify floor filter if I used below code

{{ product.price | floor | money }}
now i am getting this output with above code https://prnt.sc/Nh7EJznj4JTy

example,
if price is £47.86
and if I used this code {{ product.price | floor | money }} then I want this output £47

Store url: https://macmillan-education-staging.myshopify.com
Password: maced_international

Hello,

Firstly it makes no sense to display rounded prices to customers - just display the actual real price.

But the reason your code doesn’t work is because ‘product.price’ is actually the integer 4786 (not 47.86). The floor filter rounds to nearest integer - but your price is already an integer so does nothing.

You would likely need something like

{{ product.price | money_without_currency | round }}

You would then need to add the currency symbol

Yes, I have used this method also but in that case also facing issue with currency symbol, unable to add currency before price. Do you have any solution regarding how to add currency.

{% assign price_modulo = product.price | money_without_currency | modulo: 1 %}
{% if price_modulo >= 0.5 %}
{% assign priceRoundDown = product.price | money_without_currency | floor %}
{% assign actualPrice = priceRoundDown | plus: 0.99 %}
{{ actualPrice | money }}
{% else %}
{% assign priceRoundDown = product.price | money_without_currency | floor %}
{% assign actualPrice = priceRoundDown | plus: 0.49 %}
{{ actualPrice | money_with_currency }}
{% endif %}

Maybe like

{{ product.price | money_without_currency | round | times: 100.0 | money }}

Thank you, It’s working now