File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,22 @@ - (NSString *)descriptionWithDepth:(NSInteger)depth {
154154 [desc appendString: @" \" " ];
155155 [desc appendString: [self .object stringByReplacingOccurrencesOfString: @" \" " withString: @" \\\" " ]];
156156 [desc appendString: @" \" " ];
157+ } else if ([self .object isKindOfClass: [NSNumber class ]]) {
158+ NSNumber *obj = self.object ;
159+ if ([obj.className isEqualToString: @" __NSCFNumber" ] || [obj.className isEqualToString: @" NSDecimalNumber" ]) {
160+ NSString *defaultDescription = [self .object description ];
161+ [desc appendString: defaultDescription];
162+ if (strcmp (obj.objCType , @encode (float )) == 0 || strcmp (obj.objCType , @encode (double )) == 0 ) {
163+ if (![defaultDescription hasSubstring: @" ." ]) {
164+ [desc appendString: @" .0" ];
165+ }
166+ }
167+ } else
168+ if ([obj.className isEqualToString: @" __NSCFBoolean" ]) {
169+ [desc appendString: [self .object boolValue ] ? @" true" : @" false" ];
170+ } else {
171+ [desc appendString: [self .object description ]]; // What case could be here!?
172+ }
157173 } else {
158174 [desc appendString: [self .object description ]];
159175 }
You can’t perform that action at this time.
0 commit comments