Java code number formatting
843810Feb 27 2004 — edited Apr 3 2004Wonder if you could help me, I am a student and I've written an applet program for an assignment that creates an array of objects, each object has 3 elements. A string, another string, and a float. The float is multiplied with an integer in another method, and the resulting outputs a number which is the price of a "book". I need to format that result to show two decimal places, but when there is only one number I just get that number instead of the zero, for example if the result is 42.50 I just get 42.5. How do I get that last zero to show up, could you show me an example line of code for this number formatting? Thanks.
Tyler