NSTimeInterval to readable NSNumber
问题 NSTimeInterval == double; (e.g. 169.12345666663) How can I round up this double so that there are only 2 digits left after the "dot"? It would be very good if the result is a NSNumber. 回答1: If this is for display purposes, take a look at NSNumberFormatter. If you really want to round the double in your calculations for some reason, you can use the standard C round() function. 回答2: A NSDecimal can be rounded to a specified number of digits with NSDecimalRound(). double d = [[NSDate date]