Skip to content
This repository was archived by the owner on Jul 2, 2018. It is now read-only.

Money description not correct #57

Open
damirstuhec opened this issue Jul 30, 2016 · 7 comments
Open

Money description not correct #57

damirstuhec opened this issue Jul 30, 2016 · 7 comments

Comments

@damirstuhec
Copy link

damirstuhec commented Jul 30, 2016

README states the following:

let pounds: GBP = 99.99
let euros: EUR = 149.50
print("You have \(pounds / 2) and \(euros + 30)")

You have £ 50.00

However, I'm seeing the following result:

print("\(USD(30.5))")

Simulator:

US$30.50

Device:

50,00 US$

As you can see, there is extra locale US printed before the currency amount. Also, the locale is printed before on simulator and after the amount on device. Also, there is a different separator being used. This is not aligned with README.

How can one control all of those things?

Also, I'll take this opportunity and ask how can one optionally remove the fraction numbers in case of a whole amount?

cc @danthorpe

@damirstuhec
Copy link
Author

@danthorpe Any update on this?

@danthorpe
Copy link
Owner

Hi @damirstuhec - sorry - not had time to look into this. The issue is undoubtedly a NSLocale issue. What is the regions / language settings of your simulator/device?

@damirstuhec
Copy link
Author

@danthorpe No problem.

Simulator
Language: English
Region: US

Device
Language: English
Region: Slovenia

@danthorpe
Copy link
Owner

Okay, so the positioning of the US$ is not an error - that is how NSNumberFormatter formats US dollars for Slovenia.

The US in the simulator though - that might well be an error...

@damirstuhec
Copy link
Author

Ok, I see. But given the same locale, simulator and device should yield the same results, right?

@danthorpe
Copy link
Owner

Correct - given the same region settings, print(USD(30.5)) should yield the same result across all platforms including simulators.

@damirstuhec
Copy link
Author

Ok, thanks. Will stay tuned about the fix on simulator.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants