How can I make a double appear with only two decimal places? Current code is as follows (but of course, it’s showing a lot of decimal places):
tipPercentDbl = 20;//tipPercent as Dbl
tipDbl = (totalDbl * (tipPercentDbl/100));//tip as Dbl
tip.text = [NSString stringWithFormat:@"%f", tipDbl];
tipPercent.text = [NSString stringWithFormat:@"%f", tipPercentDbl];
totalWithTipDbl = (totalDbl+tipDbl);
totalWithTip.text = [NSString stringWithFormat:@"%f", totalWithTipDbl];
Change this
to this