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

计算大数乘法出错 #8

Open
kingstarwmx opened this issue Apr 12, 2021 · 0 comments
Open

计算大数乘法出错 #8

kingstarwmx opened this issue Apr 12, 2021 · 0 comments

Comments

@kingstarwmx
Copy link

777777*9999999结果是7777769222223.000576

- (NSString *)createResultString:(NSString *)calcuStr{ NSDecimalNumber *decimalResult = [MSParser parserComputeNumberExpression:calcuStr error:nil]; NSInteger decimalNum = 9; NSDecimal decimal = decimalResult.decimalValue; NSDecimal desDecimal; NSDecimalRound(&desDecimal, &decimal ,decimalNum, NSRoundPlain); NSDecimalNumber *result = [NSDecimalNumber decimalNumberWithDecimal:desDecimal]; NSString *res = [result stringValue]; return res; }

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

No branches or pull requests

1 participant