If the desired output is for the formatted string to always have two decimal places, I guess you would need
formatter.minimumFractionDigits = 2
Topic:
Programming Languages
SubTopic:
Swift
Tags: