mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
remove dead code
This commit is contained in:
parent
ad87ff5462
commit
0d61b42215
2 changed files with 29 additions and 35 deletions
|
@ -4,6 +4,7 @@
|
|||
* Tests/base/NSMutableAttributedString/test00.m: add sanity checks
|
||||
* Tests/base/NSMutableAttributedString/test01.m: add sanity checks
|
||||
* Source/GSString.m: raise exception on character conversion failure
|
||||
* Source/Source/NSNumberFormatter.m: remove dead code
|
||||
|
||||
2018-02-07 Yavor Doganov <yavor@gnu.org>
|
||||
|
||||
|
|
|
@ -1329,44 +1329,37 @@ static NSUInteger _defaultBehavior = NSNumberFormatterBehavior10_4;
|
|||
//fix up the fractional part
|
||||
if (displayFractionalPart)
|
||||
{
|
||||
if (0 != decimalPlaces)
|
||||
{
|
||||
NSMutableString *ms;
|
||||
NSMutableString *ms;
|
||||
|
||||
fracPart = [fracPart decimalNumberByMultiplyingByPowerOf10:
|
||||
decimalPlaces];
|
||||
ms = [[fracPart descriptionWithLocale: locale] mutableCopy];
|
||||
if ([fracPad length] > [ms length])
|
||||
{
|
||||
NSRange fpRange;
|
||||
|
||||
fpRange = NSMakeRange([ms length],
|
||||
([fracPad length] - [ms length]));
|
||||
[ms insertString:
|
||||
[fracPad substringWithRange: fpRange] atIndex: 0];
|
||||
[ms replaceOccurrencesOfString: @"#"
|
||||
withString: @""
|
||||
options: (NSBackwardsSearch | NSAnchoredSearch)
|
||||
range: NSMakeRange(0, [ms length])];
|
||||
[ms replaceOccurrencesOfString: @"#"
|
||||
withString: @"0"
|
||||
options: 0
|
||||
range: NSMakeRange(0, [ms length])];
|
||||
[ms replaceOccurrencesOfString: @"_"
|
||||
withString: @" "
|
||||
options: 0
|
||||
range: NSMakeRange(0, [ms length])];
|
||||
}
|
||||
[ms replaceOccurrencesOfString: @"0"
|
||||
withString: @""
|
||||
options: (NSBackwardsSearch | NSAnchoredSearch)
|
||||
range: NSMakeRange(0, [ms length])];
|
||||
fracPartString = AUTORELEASE(ms);
|
||||
}
|
||||
else
|
||||
fracPart = [fracPart decimalNumberByMultiplyingByPowerOf10:
|
||||
decimalPlaces];
|
||||
ms = [[fracPart descriptionWithLocale: locale] mutableCopy];
|
||||
if ([fracPad length] > [ms length])
|
||||
{
|
||||
fracPartString = @"0";
|
||||
NSRange fpRange;
|
||||
|
||||
fpRange = NSMakeRange([ms length],
|
||||
([fracPad length] - [ms length]));
|
||||
[ms insertString:
|
||||
[fracPad substringWithRange: fpRange] atIndex: 0];
|
||||
[ms replaceOccurrencesOfString: @"#"
|
||||
withString: @""
|
||||
options: (NSBackwardsSearch | NSAnchoredSearch)
|
||||
range: NSMakeRange(0, [ms length])];
|
||||
[ms replaceOccurrencesOfString: @"#"
|
||||
withString: @"0"
|
||||
options: 0
|
||||
range: NSMakeRange(0, [ms length])];
|
||||
[ms replaceOccurrencesOfString: @"_"
|
||||
withString: @" "
|
||||
options: 0
|
||||
range: NSMakeRange(0, [ms length])];
|
||||
}
|
||||
[ms replaceOccurrencesOfString: @"0"
|
||||
withString: @""
|
||||
options: (NSBackwardsSearch | NSAnchoredSearch)
|
||||
range: NSMakeRange(0, [ms length])];
|
||||
fracPartString = AUTORELEASE(ms);
|
||||
[formattedNumber appendString: [self decimalSeparator]];
|
||||
[formattedNumber appendString: fracPartString];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue