0

I want to print 5 digit after point in Swift 4. In C language i can do it as .5f but now i can't. Have any shortest code to do this?

1 Answers1

1
String(format: "%.5f", 1.831831)
ukim
  • 2,395
  • 15
  • 22
  • While this code may answer the question, providing additional context regarding how and/or why it solves the problem would improve the answer's long-term value. – Nic3500 Aug 07 '18 at 00:27