package chapter29;

// PrecisionTest.java
// Using precision for floating-point numbers and strings.
public class PrecisionTest
{
    public static void main( String args[] )
    {
        double f = 123.94536;
        String s = "Happy Birthday";

        System.out.printf( "Using precision for floating-point numbers\n" );
        System.out.printf( "\t%.3f\n\t%.3e\n\t%.3g\n\n", f, f, f );

        System.out.printf( "Using precision for strings\n" );
        System.out.printf( "\t%.11s\n", s );
    } // end main
} // end class PrecisionTest
