UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

How do I get UK currency on my UK Mac?

Forums > 100 Days of SwiftUI

Hi

Text(Locale.current.currency?.identifier ?? "XYZ") Text(100.00, format: .currency(code: Locale.current.currency?.identifier ?? "GBP" ))

The first Text command outputs "USD" and the second $100.00.

Can I please ask for some help in understanding why my Mac which is using UK £'s everywhere, in every other app, is not doing the same in Xcode, where is it getting USD and $'s from?

I had expected Xcode to default to the same as my MAC but this does seem to be the case.

Any help appreciated.

Regards

2      

In Xcode in your project settings there is a section Localization. The "Base" Developer language is usually English US and doesn't respect your Mac settings. F.e. my regional settings on my Mac are German and in a new project Xcode just doesn't care. You can add English UK. If you develop for iPhone and use the simulator you have to change the regional settings on the iPhone simulator as well.

2      

Hi, I am really sorry but can I please ask you to be much more specefic about what I need to change. I've found Localization and added English UK but my project is still in USD.

Thank you for your help

2      

What kind of app are you developing? MacOS, iOS?

2      

Hacking with Swift is sponsored by Superwall

SPONSORED Superwall lets you build & test paywalls without shipping updates. Run experiments, offer sales, segment users, update locked features and more at the click of button. Best part? It's FREE for up to 250 conversions / mo and the Superwall team builds out 100% custom paywalls – free of charge.

Learn More

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.