Set some sensible defaults to NSNumberFormatter.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31960 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Stefan Bidigaray 2011-01-27 23:29:41 +00:00
parent 3029c5982c
commit d80a4a55f2
2 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,7 @@
2011-01-27 Stefan Bidigaray <stefanbidi@gmail.com>
* Source/NSNumberFormatter.m: Set some sensible defaults.
2011-01-26 Stefan Bidigaray <stefanbidi@gmail.com>
* Source/NSLocale.m: Add currency code to locale identifier, if present.

View file

@ -428,8 +428,17 @@ static NSUInteger _defaultBehavior = 0;
_behavior = _defaultBehavior;
_locale = RETAIN([NSLocale currentLocale]);
_style = NSNumberFormatterDecimalStyle;
[self _resetUNumberFormat];
if (_formatter == NULL)
{
RELEASE(self);
return nil;
}
// Set default values...
[self setMaximumFractionDigits: 2];
return self;
}