Re: Need help to make this method prettier

2008-11-02 Thread Andre Masse
I tried at first to use the standard NSNumberFormatter in IB but couldn't find the right pattern. Your solution works great and don't require subclassing so thanks a lot. Andre Masse On Nov 1, 2008, at 16:09, Bill Bumgarner wrote: Use the APIs whenever possible. int main (int argc,

Re: Need help to make this method prettier

2008-11-01 Thread Graff
On Nov 1, 2008, at 1:56 PM, Andre Masse wrote: I'm implementing a custom NSFormatter. I want a number with 9 digits displayed as 123 456 789. So before implementing the formatter I made a test project to check the conversion. The version I did get the job done but its not pretty :-) Any more

Re: Need help to make this method prettier

2008-11-01 Thread Louis Demers
On 1-Nov-08, at 13:56 , Andre Masse wrote: The version I did get the job done but its not pretty :-) Any more good looking solutions? if (first 10) { str0 = [NSString stringWithFormat:@00%d, first]; } else if (first 100){

Re: Need help to make this method prettier

2008-11-01 Thread Bill Bumgarner
On Nov 1, 2008, at 1:56 PM, Andre Masse wrote: I'm implementing a custom NSFormatter. I want a number with 9 digits displayed as 123 456 789. So before implementing the formatter I made a test project to check the conversion. The version I did get the job done but its not pretty :-) Any more