Added a few more methods to NSNumberFormatter and implemented NSLocale code that required changes to NSNumberFormatter. NSLocale now passes all tests in the testsuite.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31863 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
stefanbidi 2011-01-09 21:16:20 +00:00
parent 241e106a22
commit 57494d4103
3 changed files with 83 additions and 7 deletions

View file

@ -414,7 +414,7 @@ static NSUInteger _defaultBehavior = 0;
RELEASE(o);
_behavior = _defaultBehavior;
_locale = [NSLocale currentLocale];
_locale = RETAIN([NSLocale currentLocale]);
[self _openUNumberFormat];
return self;
@ -1315,12 +1315,20 @@ static NSUInteger _defaultBehavior = 0;
- (void) setCurrencyCode: (NSString *) string
{
#if GS_USE_ICU == 1
[self _setTextAttribute: string : UNUM_CURRENCY_CODE];
#else
return;
#endif
}
- (NSString *) currencyCode
{
#if GS_USE_ICU == 1
return [self _getTextAttribute: UNUM_CURRENCY_CODE];
#else
return nil;
#endif
}
- (void) setInternationalCurrencySymbol: (NSString *) string
@ -1353,37 +1361,65 @@ static NSUInteger _defaultBehavior = 0;
- (NSString *) positivePrefix
{
#if GS_USE_ICU == 1
return [self _getTextAttribute: UNUM_POSITIVE_PREFIX];
#else
return nil;
#endif
}
- (void) setPositiveSuffix: (NSString *) string
{
#if GS_USE_ICU == 1
[self _setTextAttribute: string : UNUM_POSITIVE_SUFFIX];
#else
return;
#endif
}
- (NSString *) positiveSuffix
{
#if GS_USE_ICU == 1
return [self _getTextAttribute: UNUM_POSITIVE_SUFFIX];
#else
return nil;
#endif
}
- (void) setNegativePrefix: (NSString *) string
{
#if GS_USE_ICU == 1
[self _setTextAttribute: string : UNUM_NEGATIVE_PREFIX];
#else
return;
#endif
}
- (NSString *) negativePrefix
{
#if GS_USE_ICU == 1
return [self _getTextAttribute: UNUM_NEGATIVE_PREFIX];
#else
return nil;
#endif
}
- (void) setNegativeSuffix: (NSString *) string
{
#if GS_USE_ICU == 1
[self _setTextAttribute: string : UNUM_NEGATIVE_SUFFIX];
#else
return;
#endif
}
- (NSString *) negativeSuffix
{
#if GS_USE_ICU == 1
return [self _getTextAttribute: UNUM_NEGATIVE_SUFFIX];
#else
return nil;
#endif
}