NSString output percentage% cannot be displayed

When displaying the half-percent % symbol through NSString splicing, you will encounter a situation where the % is spliced ​​but the UI fails to display;

Solution

Use the %% expression where % needs to be added to successfully output.

[NSString stringWithFormat:@"%.f%%", deviceLevel * 100];


The above is all the content shared this time, I hope it can be helpful to everyone!

Guess you like

Origin blog.csdn.net/survivorsfyh/article/details/131470655