There may be a more direct way to achieve it (which I don't know) but here's a suggestion...
- Convert to string as you already do.
- Use
[myString hasSuffix:@"0"]
to see if it ends in zero. - Use
[myString substringToindex:[myString length]-1]
to create a new string without the final zero. - Repeat.
I know it's not elegant, but unless someone has a better solution, this will at least do what you want.
UPDATE: scratch that - I just discovered [myString stringByTrimmingCharactersInSet:set]
. Surely this must be what you need...?