0

Possible Duplicate:
core-plot remove decimal points from axis labels

I 'am building a Scatterplot with the help of Core Plot 1.0 version. The Graphs X and the Y value are being printing like 15.0,18.0,etc.. instead of 15 18 and so on. How can I round the value???

Community
  • 1
  • 1
thurmi
  • 51
  • 1
  • 1
  • 9

3 Answers3

1

You can use NSNumber to convert your float values.

float aFloatValue = 15.0;
NSNumber number = [[NSNumber alloc] initWithFloat:aFloatValue];
int aRoundedInt = [number intValue];
[number release];
Herm
  • 2,956
  • 19
  • 32
-1

You can just cast your float values to int.

int newValue = (int)floatValue;

James
  • 2,272
  • 1
  • 21
  • 31
  • I 've done that Already but I think its belongs to Core plot(Framework) Library bundle. Because I ve had a looked in to some of .h files of Coreplot and it seems to be very complex to discover the place where the round of "plotrange x and y" is happening .. Any ideas according to Coreplot Framework – thurmi May 25 '12 at 09:46
-3

i dont really understand what is your question but you can try to split your string, With PHP Or JavaScript Both can do the job one is server side and on is client side, Have a nice day.

Blanktext
  • 1,528
  • 3
  • 12
  • 17