I get 0%. Here's my code:
print(tipc)
let percentString = String(format: "%.0f%%", tipc)
print(percentString)
18.181818181818183
0%.
What did I do wrong?
Yes that works. But what if I don't know what's going to be in the array? It's for a pizza delivery program. The array holds the cost of the deliveries. In myfunc I want to print each element out to the screen. Thanks for your help.
I get 0%. Here's my code:
print(tipc)
let percentString = String(format: "%.0f%%", tipc)
print(percentString)
18.181818181818183
0%.
What did I do wrong?
Yes that works. But what if I don't know what's going to be in the array? It's for a pizza delivery program. The array holds the cost of the deliveries. In myfunc I want to print each element out to the screen. Thanks for your help.