Need to remove decimal and cents in price?

Highlighted
Tourist
36 0 2

Thank you, Ugurcan!

0 Likes
Highlighted
Tourist
36 0 2

ONE LAST QUESTION:

I am trying to place the "rewards" image to the left, and on the same line beside it, I want the $rewards back price , in this link it is $9.00. Here is my current code:

LINK: http://www.sugarloft.ca/collections/lighting/products/afrono-table-lamp

        <div class="purchase">
        <h2 class="price" id="price-preview">{{ variant.price | money }}{% if variant.price < variant.compare_at_price %} <del>{{ variant.compare_at_price | money }}</del>{% endif %}</h2> 
            <h2><p class="price" id="price-preview">{{ product.price | remove: '.00'|divided_by: 25 | money }}</p></h2>
           <img src="{{ 'rewd.jpg' | asset_url }}" style="height: YYpx; width: XXpx" title="My image" />

What do I do??

0 Likes
Highlighted
New Member
1 0 0

Might be a silly question:

How can I have the cents removed within the store, but have the accurate shipping and tax amounts show upon checkout? The change in settings that T Finch mentions above rounds everything up (e.g. $5.57 = $6). Should I just add this snippet to all the pages that I desire the .00 to not be displayed (all products in store are whole prices)?


{{ product.price | money | remove: '.00' }}
 

0 Likes
Highlighted
Shopify Partner
2 0 0

I'm trying to add a line below my total so people can see how many loyalty points they generate with each purchase. Each 1$=1 loyalty point so I want to eliminate the decimals completly from the total amount.

ex: 16.87$ => 16 loyalty points        

so far my code is:     {{total_price | money_without_currency_round_up}}

I have tried adding :

| remove: '.00'}}              which only revomes .00 and no other decimals
|​​​​​​​ divided_by: 10 }}            which gives me 0.1687
| amount_no_decimals}}         which gives me 1687

I'm thinking a code that would intergrate the number maybe? But all i've tried just nullifies the entry

Any idea what other code I could try?

0 Likes
Highlighted
Shopify Partner
2 0 0

never mind I got It! 

{{total_price | divided_by: 100  | integral_money_without_currency }}

0 Likes
Highlighted
Tourist
10 0 4

This is solved easily. Simply go to Settings---> General. Change currency formatting and replace all the {{amount}} with {{amount_no_decimals}}. 

Done.

1 Like
Highlighted
Shopify Partner
8 0 2

I'm trying to insert a sentence beside each product that shows how many reward points a customer will receive. You get 1 point per dollar spent, and it does not round up. So if you buy something for 17.99, I want it to return "You will receive 17 reward points" and not "you will receive 1799 reward points." Any way to remove/round down any cents?

0 Likes
Highlighted
New Member
1 0 0

Thanks for the straightforward reply!

I tried adding: | remove: '.00'
After ever occurrence I could find of: product.price | money_without_currency
Except for in cart.liquid. But this did nto do anything at all :(.

Any ideas where I might be messing up?

 

Thanks!

0 Likes
Highlighted
New Member
1 0 0

Hey guys, I am using HUF currency (a rare one isnt it?) for Hungarian store and trying to set up price rounding as follows:

if 1455, than new price is 1460
if 1454, than new price is 1450

Any ideas?

0 Likes