Skip to content

Instantly share code, notes, and snippets.

@zwang
Last active March 18, 2016 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zwang/17f4862ef163b954b2c5 to your computer and use it in GitHub Desktop.
Save zwang/17f4862ef163b954b2c5 to your computer and use it in GitHub Desktop.
Convert double to string in swift with more than default 15 decimals (a bug in swift should be fixed later)
// https://github.com/apple/swift/pull/348
private func getDoubleStrWith16DecimalDigits(value: Double) -> String {
return String(format: "%.16f", value)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment