Created
October 15, 2020 18:24
-
-
Save foxicode/4f7720feb2c1cb2363765cf3d1b4f665 to your computer and use it in GitHub Desktop.
Formatting price in Swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| let price = 1.5 | |
| let strPrice = String(format: "%.02f", price) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment