CGFloat f = 123.1234567890; NSString *str=[NSString stringWithFormat:@」%.2f」, f]; 如上所述:字符串格式化,格式出輸入%.2f ,及表示兩位小數orm
若是取後3位即 %.3f 後4位即 %.4f字符串