How to round up converted currencies

Kevin_Steinberg
New Member
8 0 0

Hi everyone,

I'm launching my site soon, please check it out here: www.thejapaneseselectshop.com, password is "klawbu".

I'm based in Japan and my default currency is JPY. Prices look nice in JPY but when converted in other currencies they are not rounded up and it looks visually unpleasing: "74.23$" for example.

The theme that I use is Jemiz and the team behind this theme, though they've been awesome and I love working with them, haven't been able to help me round up converted prices. What I'd like to achieve is that prices like "74.23" or "86.78" respectively become "75" and "87".

I've been wanting to get this fixed for ever now and I really hope someone can help me figure this out!

Thanks

0 Likes
Jason
Shopify Expert
10037 119 1873

Hard to give much insight here since your store is locked (and I don't have access to the theme your are using).

If that theme uses the default currrency conversion scripts (as noted here) you would need to look at editing the conversion function to so the returned value is rounded.

If you're already working with a theme developer this would be a very quick edit.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Kevin_Steinberg
New Member
8 0 0

Hey Jason, thanks for your reply. The password to access my store is "klawbu", please try and let me know if you're still having trouble accessing it.

The theme I'm using is "Jemiz". The team is great and I'm not trying to throw them under the bus here because they've really been amazing with everything else, but they said they weren't able to do this edit and here's the reason:

We spend over 1 hour to check it and we found the problem caused by the text in "Currency" Change formatting. You have insert the text "amount_no_decimals" in format. We think you want don't have .00 after the price. But the currency jquery code don't work with this mode.

Let me know what you think,

Kevin

0 Likes
Jason
Shopify Expert
10037 119 1873

You could probably just insert this line...

cents = Math.ceil(cents/100)*100;

...before this one. Totally untested of course, but the idea is there to do the rounding. If you need to remove the .00 as well:

newFormattedAmount = newFormattedAmount.replace('.00','')

 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Kevin_Steinberg
New Member
8 0 0

OK will try! Thanks again Jason, much appreciated.

0 Likes
Jason
Shopify Expert
10037 119 1873

If you get stuck I'll try and edit a theme here that's using the currency convertor. 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Kevin_Steinberg
New Member
8 0 0

So the currency file I have in the theme is "jquery.currencies.min.js".

I couldn't find anything close to what you showed me and I don't want to mess up the code so would that help if I pasted the code inside jquery.currencies.min.js here? Or do you think it's better and more simple that I send your comment to my theme's support team?

Let me know what you think is best,

Kevin

0 Likes
Kevin_Steinberg
New Member
8 0 0

Hey Jason,

I got some feedback from the people working on my site, here it is:

We checked this code. This code is good. But we don't find out where to use it. Because the currency convert we follow the tips from Shopify, and the js can insert this code is jquery.currencies.min.js , but we don't font our these variable to check it. Could you please try contact with this code provider about how to use it.

So yeah, I can totally see how it's kinda weird for you to help them since they're supposed to know that stuff but you'd make my day if you helped me here, because this is seriously bothering me, ha.

Kevin

0 Likes
Jason
Shopify Expert
10037 119 1873

So the currency file I have in the theme is "jquery.currencies.min.js".

Well that's slightly more painful. The "min" part is just a nice naming convention to let you know the code is minified (stripped of whitespace). That won't be the easiest file to edit. The link in earlier posts links to the un-minified / original source so that will be far easier to tinker with.

See if this help.

The two additions to the main code are here and here.

 

 

 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Kevin_Steinberg
New Member
8 0 0

Hey Jason,

Sorry it looks like I'm not going to be able to do that myself... What would be your rate to solve this issue? Don't know if it's appropriate to ask this kind of question openly here but there's no option to direct message you.

Thanks

0 Likes