Home Segments Index Top Previous Next

493: Mainline

Defining a formatting method for Float instances is a little more involved, because you usually want to specify not only the field width, but also the number of digits to follow the decimal point. Accordingly, you might want to define a method with an argument, formatWithWidth:andFraction:, with the andFraction: argument controlling the number of post–decimal-point digits.