swift5 字符串格式化保留2 位,缺0自动补0 String(format: “%02d:%02d”, min,sec) String(format: “%.2f:%.2f”, min,sec),就是保留2位小数,一般在结算金额,计算价格的时候需要用到,还有其他情况 本质就是OC的东西