ios - How to add percent sign in string format? -
this question has answer here:
- how add percent sign nsstring 7 answers
i want string "99.99%"
double
,and used format this:
let rate = 99.99999 let str = string(format: "%.2f%", rate) // output 99.99
and \%
not allowed. how add percent sign in string format, please me!
write 2 time %:
rate = 99.99 let str = string(format: "%.2f%%", rate)
Comments
Post a Comment