Is it possible to convert the format that comes out of converted(to: UnitVolume.metricCups)
into a fraction so the answer is read just like you would from say a cookbook etc.
Example after the conversion is complete I get an answer of 1.5 metric cups
, but I would like to see it as 1 1/2
or say 0.333
as 1/3 cup
.
Swift documentation doesn't really mention any steps for this that I'm aware of. Thank you.
This is what the storyboard looks like:
let millimeters = Measurement(value: waterResult, unit: UnitVolume.milliliters)
let resultWaterConversion = millimeters.converted(to:UnitVolume.metricCups)
cupsWater.text = "\(resultWaterConversion)"