Questions tagged [nsdecimalnumber]

NSDecimalNumber, an immutable subclass of NSNumber, provides an object-oriented wrapper for doing base-10 arithmetic. An instance can represent any number that can be expressed as mantissa x 10^exponent where mantissa is a decimal integer up to 38 digits long, and exponent is an integer from –128 through 127.

NSDecimalNumber, an immutable subclass of NSNumber (), provides an object-oriented wrapper for doing base-10 arithmetic. An instance can represent any number that can be expressed as mantissa x 10^exponent where mantissa is a decimal integer up to 38 digits long, and exponent is an integer from –128 through 127.

244 questions
-2
votes
2 answers

How to use NSDecimalNumber to convert latitude and longitude in IOS

I would like to show my position on the map, I'm using CLLocation for doing it Here is my code: CLLocationCoordinate2D coordinate; coordinate.latitude = latitude; coordinate.longitude = longitude; With latitude and longitude is float type and get…
-3
votes
2 answers

Inconsistency converting decimal to double (Objective C)

XCode 9.4.1. In debugger console I see results that seem strange to me: (lldb) print (double)0.07 (double) $0 = 0.070000000000000007 (lldb) print [(NSDecimalNumber*)[NSDecimalNumber decimalNumberWithString:@"0.07"] doubleValue] (double) $1 =…
jesse
  • 650
  • 5
  • 19
-3
votes
3 answers

[NSDecimalNumber Length]:unrecognized selector sent to instance

I am getting an error when on a simple TableViewController Project as it looks like I am trying to force an NSDecimalNumber object into the text of a label called CheckValue.text as part of the cellForRowAtIndexPath method. And truth be told, I am…
Rob4236
  • 375
  • 1
  • 7
  • 12
-5
votes
2 answers

What is the best way to convert an array with NSStrings to NSDecimalNumber?

I have an NSArray with 10 NSStrings inside: myArray ( @"21.32", @"658.47", @"87.32"... ) What's the best way to convert all the strings to an NSDecimalNumber?
Legend
  • 3
  • 1
1 2 3
16
17