From the course: iOS Development Tips

Unlock this course with a free trial

Join today to access over 23,200 courses taught by industry experts.

Number formatters

Number formatters

- [Instructor] Last tip, we looked at formatters for dates. This week, let's look at the new iOS 15 formatters for numbers and lists. I have a playground here that I've set up a few variables to play with. Now I can make a string using the basic formatter, like this, for display. So I'm just going to put in here radius is, plus radius, and I just have to take this and put the word formatted after it. And that's all I need. And I'm going to just keep going like this, and I'll put a comma after that. Area is. I'll put another space there, and then I can do the same thing with the area. And finally, and volume is. I'll do the same thing with that, put me a space there. Okay. And we can try to run that. And we got a nice statement here. And we don't need this over here. So I'm going to close that up, so we have a little more space. And we get this as strings and it's put this as a string. We first, when we…

Contents