-5

Im dividing 2 double values with this code:

  float final = cw / q ;
  label.text = [NSString stringWithFormat:@"%g", final];

this code works perfectly but the how can i move the decimal point two spaces to the right.

Like this: .500000 to 50.000 or just 50

Thanks

matt saravitz
  • 157
  • 2
  • 15

1 Answers1

4

Erm, how about multiplying by 100 before converting to text?

float final =  ( cw / q ) * 100.0;
Gnudiff
  • 4,297
  • 1
  • 24
  • 25