0

I want to convert a float value of 0.125 into fraction as 1/8, so that I can display it on a UILabel.

I receive the float value from the server and need to load that in UITableView in a fraction format.

Abhishek
  • 184
  • 11
  • See this question https://stackoverflow.com/questions/35895154/decimal… – Alexander MacLeod Mar 07 '18 at 13:25
  • 1
    Is it always something/8? Seems more of a maths problem rather a Swift one. – Larme Mar 07 '18 at 13:26
  • Look here : [https://stackoverflow.com/questions/5968636/converting-a-float-into-a-string-fraction-representation](https://stackoverflow.com/questions/5968636/converting-a-float-into-a-string-fraction-representation) – Evehne Mar 07 '18 at 13:26

0 Answers0