Skip to content

Commit

Permalink
Change NSNumberFormatter minimum/maximum properties from NSDecimalNum…
Browse files Browse the repository at this point in the history
…ber to NSNumber to match Apple platforms
  • Loading branch information
triplef committed Aug 10, 2023
1 parent cd231a3 commit 668d6c4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2023-08-10 Frederik Seiffert <[email protected]>

* Headers/Foundation/NSNumberFormatter.h:
* Source/NSNumberFormatter.m:
Change NSNumberFormatter minimum/maximum properties from
NSDecimalNumber to NSNumber to match Apple platforms.

2023-07-30 Yavor Doganov <[email protected]>

* Tools/HTMLLinker.1: Fix a groff warning.
Expand Down
12 changes: 6 additions & 6 deletions Headers/Foundation/NSNumberFormatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ GS_EXPORT_CLASS
unichar _thousandSeparator;
unichar _decimalSeparator;
NSDecimalNumberHandler *_roundingBehavior;
NSDecimalNumber *_maximum;
NSDecimalNumber *_minimum;
NSNumber *_maximum;
NSNumber *_minimum;
NSAttributedString *_attributedStringForNil;
NSAttributedString *_attributedStringForNotANumber;
NSAttributedString *_attributedStringForZero;
Expand Down Expand Up @@ -337,25 +337,25 @@ GS_NSNumberFormatter_IVARS;
* Returns maximum value that will be accepted as valid in number parsing.
* Default is none.
*/
- (NSDecimalNumber*) maximum;
- (NSNumber*) maximum;

/**
* Sets maximum value that will be accepted as valid in number parsing.
* Default is none.
*/
- (void) setMaximum: (NSDecimalNumber*)aMaximum;
- (void) setMaximum: (NSNumber*)aMaximum;

/**
* Returns minimum value that will be accepted as valid in number parsing.
* Default is none.
*/
- (NSDecimalNumber*) minimum;
- (NSNumber*) minimum;

/**
* Sets minimum value that will be accepted as valid in number parsing.
* Default is none.
*/
- (void) setMinimum: (NSDecimalNumber*)aMinimum;
- (void) setMinimum: (NSNumber*)aMinimum;

#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
/** Sets the behavior of the formatter.<br />
Expand Down
8 changes: 4 additions & 4 deletions Source/NSNumberFormatter.m
Original file line number Diff line number Diff line change
Expand Up @@ -900,12 +900,12 @@ - (BOOL) localizesFormat
return _localizesFormat;
}

- (NSDecimalNumber*) maximum
- (NSNumber*) maximum
{
return _maximum;
}

- (NSDecimalNumber*) minimum
- (NSNumber*) minimum
{
return _minimum;
}
Expand Down Expand Up @@ -1002,13 +1002,13 @@ - (void) setLocalizesFormat: (BOOL)flag
_localizesFormat = flag;
}

- (void) setMaximum: (NSDecimalNumber*)aMaximum
- (void) setMaximum: (NSNumber*)aMaximum
{
// FIXME: NSNumberFormatterBehavior10_4
ASSIGN(_maximum, aMaximum);
}

- (void) setMinimum: (NSDecimalNumber*)aMinimum
- (void) setMinimum: (NSNumber*)aMinimum
{
// FIXME: NSNumberFormatterBehavior10_4
ASSIGN(_minimum, aMinimum);
Expand Down

0 comments on commit 668d6c4

Please sign in to comment.