iphone Programming Glossary: doublevaluewithmaxtwodecimalplaces
Limit a double to two decimal places without trailing zeros http://stackoverflow.com/questions/4026135/limit-a-double-to-two-decimal-places-without-trailing-zeros viewDidLoad super viewDidLoad UILabel myLabel UILabel alloc initWithFrame CGRectMake 50 100 200 20 NSNumberFormatter doubleValueWithMaxTwoDecimalPlaces NSNumberFormatter alloc init doubleValueWithMaxTwoDecimalPlaces setNumberStyle NSNumberFormatterDecimalStyle doubleValueWithMaxTwoDecimalPlaces.. CGRectMake 50 100 200 20 NSNumberFormatter doubleValueWithMaxTwoDecimalPlaces NSNumberFormatter alloc init doubleValueWithMaxTwoDecimalPlaces setNumberStyle NSNumberFormatterDecimalStyle doubleValueWithMaxTwoDecimalPlaces setPaddingPosition NSNumberFormatterPadAfterSuffix.. NSNumberFormatter alloc init doubleValueWithMaxTwoDecimalPlaces setNumberStyle NSNumberFormatterDecimalStyle doubleValueWithMaxTwoDecimalPlaces setPaddingPosition NSNumberFormatterPadAfterSuffix doubleValueWithMaxTwoDecimalPlaces setFormatWidth 2 NSNumber myValue..
|