Skip to content
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

Change NSNumberFormatter minimum/maximum properties type #310

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading