printf « float « Java Data Type Q&A





1. "printf" applied to a float using a Parameter    coderanch.com

Hey Ritchie, thanks once again for all the help and prodding in the right direction ... here's how i finally solved the problem: public void printFloat(Rational bruch1){ int numer = bruch1.getNumer(); int denom = bruch1.getDenom(); int afterKoma = 1; double floatValue1 = (float) (numer); double floatValue2 = (float) (denom); double theFloatValue = floatValue1/floatValue2; System.out.println ("how many positions after the decimal point?"); ...