I have some code to format a file size string:
NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
[numberFormatter setPositiveFormat: @"#,##0.## bytes"];
Is the @"#,##0.## bytes" the same kind of format string as I'd use in stringWithFormat? What do the hash/pound symbols mean here?
# will usually be replaced by a number if one exists, and nothing if it doesn't. 0 will be replaced by a number if one exists, and zero if it does not.
So for the following formatting '##00.00##' you would get the following outputs:
1 => 01.00
12.1 => 12.10
1234.5 => 1234.50
1.2345 => 01.2345
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