How do I ensure that there are only 2 decimal places for this equation (which is converted into a string) in swift.
let avocadoE = ((Double(proteinIntake)!/4.73) * (1/Double(list.count)))
let avocadoP = String(avocadoE)
The values proteinIntake and lis.count are already defined in my code. I can't seem to find any solutions online.