I want to get string like "99.99%"
from Double
,and I used format to get this:
let rate = 99.99999 let str = String(format: "%.2f%", rate) // output 99.99
And \%
is not allowed. So how to add percent sign in string format, please help me!
write %
twice:
rate = 99.99 let str = String(format: "%.2f%%", rate)
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