I am trying to build a small table using NSString. I cannot seem to format the strings properly.
Here is what I have
[NSString stringWithFormat:@"%8@: %.6f",e,v]
where e is an NSString from somewhere else, and v is a float.
What I want is output something like this:
Grapes: 20.3
Pomegranates: 2.5
Oranges: 15.1
What I get is
Grapes:20.3
Pomegranates:2.5
Oranges:15.1
How can I fix my format to do something like this?
you could try using - stringByPaddingToLength:withString:startingAtIndex:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With