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

Fix decimal number transform to bool bug #726

Conversation

kinarobin
Copy link
Collaborator

No description provided.

@kinarobin kinarobin requested a review from wolfcon September 9, 2019 12:29
@CoderMJLee CoderMJLee merged commit bb9aca2 into CoderMJLee:master Sep 10, 2019
@kinarobin kinarobin deleted the fix_decimal_number_transform_to_bool_bug branch September 10, 2019 01:59
@@ -159,7 +159,8 @@ - (instancetype)mj_setKeyValues:(id)keyValues context:(NSManagedObjectContext *)
if (type.typeClass == [NSDecimalNumber class]) {
value = [NSDecimalNumber decimalNumberWithString:oldValue];
} else {
value = @([NSDecimalNumber decimalNumberWithString:oldValue].doubleValue);
NSDecimalNumber *decimalValue = [NSDecimalNumber decimalNumberWithString:oldValue];
value = decimalValue == [NSDecimalNumber notANumber] ? @(0) : @(decimalValue.doubleValue);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants