0

xcode can use Decimal 3 place?

Example:

NSDecimal *test = 1.0.0; //not work
double test = 1.0.0; //not work
float test = 1.0.0; //not work

Can I use decimal 3 place in xcode?

2 Answers2

0

Version numbers like 1.0.3 are neither floating point nor decimal numbers. If you need to store them in a variable, use a string:

NSString *test = @"1.0.0";
Greg Hewgill
  • 951,095
  • 183
  • 1,149
  • 1,285
0

Use string and componentsSeparatedByString: method and then convert each object in array to appropriate format.

Nikolai Nagornyi
  • 1,312
  • 2
  • 11
  • 26