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      

TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!

Find out 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.