Skip to content

[SR-789] Remove localization of NSNumber.description #296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2016

Conversation

seabaylea
Copy link
Contributor

This is for SR-789 which reports that NSNumber.description is providing a localised string whereas it didn't do so previously.

In order to be behaviour compatible I've made a slight modification to the existing implementation to use a number formatter style of kCFNumberFormatterNoStyle rather than kCFNumberFormatterDecimalStyle.

At the same time I've done some refactoring to improve the delegation between description and descriptionWithLocale() as suggested in PR #277 and added tests for both description and descriptionWithLocale()

// let formatter = CFNumberFormatterCreate(nil, locale, kCFNumberFormatterNoStyle)
// CFNumberFormatterSetProperty(formatter, kCFNumberFormatterMaxFractionDigits, 15._bridgeToObject())
// return CFNumberFormatterCreateStringWithNumber(nil, formatter, self._cfObject)._swiftObject
// }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably can remove the commented out code. git history is a beautiful thing ;)

@parkera
Copy link
Contributor

parkera commented Apr 28, 2016

I will merge this and we can follow up on @phausler's suggestion.

@parkera parkera merged commit 3267309 into swiftlang:master Apr 28, 2016
@seabaylea seabaylea deleted the SR-789 branch May 11, 2016 18:41
atrick pushed a commit to atrick/swift-corelibs-foundation that referenced this pull request Jan 12, 2021
Dup and redirect stdout to defend against accidental print()
kateinoigakukun pushed a commit to kateinoigakukun/swift-corelibs-foundation that referenced this pull request Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants