Skip to content

Instantly share code, notes, and snippets.

@novinfard
Created June 29, 2021 01:25
Show Gist options
  • Save novinfard/9c7748435cee56b08d0dc896d0547a9e to your computer and use it in GitHub Desktop.
Save novinfard/9c7748435cee56b08d0dc896d0547a9e to your computer and use it in GitHub Desktop.
[Update SwiftUI app to demonstrate English number converter]
var body: some View {
VStack(spacing: 16) {
Text(text)
HStack {
Spacer()
.frame(width: 16)
image
Spacer()
}
// a Persian number
Text(String("۱۲۳۱۲۳۵۶"))
// a Persian number converted to its English equivalent
Text(String("۱۲۳۱۲۳۵۶".toEnglishNumberInt ?? 0))
Spacer()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment