d
Topic
emily jane Shopify Partner
Posts:
13
November 08, 2012

Round Price to Nearest Dollar This post is outdated

Hi,

On the cart page of my store I would like the total of each line to be rounded to the nearest full dollar.  Is this possible?   

 

Instead of this:

6 x Umbrellas - $66.99

5 x Hats - $50.00

Total - $116.99

 

I want this:

6 x Umbrellas - $67.00

5 x Hats - $50.00

Total - $117.00

 

I am pretty good with liquid but havent found any filters for this type of thing.

 

Thanks,

Emily

 

i
Replies
Posts:
2770
November 08, 2012

set your prices to all end in .00 and like magic... the non-zero cents just disappear.

Specializing in Custom Shopify Apps hunkybill@gmail.com http://www.resistorsoftware.com
emily jane Shopify Partner
Posts:
13
Last edited November 08, 2012

Thanks for the fast reply, Bill.

The prices are automatically generated by some external software and are based on production costs.   They are only sold in set quantities.

Some of the prices per unit are very low (less than a dollar) but the set quantities are up to 10,000. I cant round the price per unit to the nearest dollar because it will effect the price drastically.  But rounding the total for the whole quantity would be perfect.

The software that generates the prices rounds to a whole dollar amount for a set quantity, then divides that price by the number of units to get the price per unit.  Unfortunately sometimes the price for the whole set quantity is a few cents off because of the divisibility of the numbers.  I was hoping Shopify would have some kind of filter to round to a full dollar amount.

My client does not want cents to be part of the prices for aesthetic reasons.

Thanks,

Emily

Jamie Chief Officer of Funness shopify.com/plus
Posts:
5860
November 08, 2012

There is no way to do this on the cart level. I would take care of this rounding in the product import.

http://shopifyplus.com ::: http://twitter.com/bacchus
emily jane Shopify Partner
Posts:
13
November 08, 2012

OK.  Is this something that an expert could do with some kind of fancy programming, or is it just not possible?

Thanks

Emily

Jamie Chief Officer of Funness shopify.com/plus
Posts:
5860
November 08, 2012

Dave may have a clever idea, but I can almost tell you that even if is is possible the work involved wouldn't justify the changes for aesthetic reasons :)

http://shopifyplus.com ::: http://twitter.com/bacchus
emily jane Shopify Partner
Posts:
13
November 08, 2012

Thanks Jamie.  I understand.

E

 

Posts:
2
November 15, 2012

Interesting... I'm having the opposite problem: All my prices are rounded and I want to be able to display cents.  Once I figure out what's going on I'll let you know...

Posts:
2
November 15, 2012

Found it! 

Under "Preferences"->"General Settings", scroll down to "Money" under the section "Adjust your settings and formats", click "formatting" to expand out the currency display options.  You'll want to put this value in: ${{amount_no_decimals}}

Looks like that's a bit of liquid... so you can probably use this in your templates, too, but I haven't tested at all.

 

Cheers!

Log in or sign up for an account to reply.

This thread has been closed! You will not be able to reply.