All pastes #164847 Raw Edit

Mine

public text v1 · immutable
·published 2006-09-09 01:47 UTC
rendered paste body
public class Format
{
	public static void main(String[] arg)
	{
		double bankBalance = 3456.7;
		
		DecimalFormat frm = new DecimalFormat("0.00");
		
		frm.format(bankBalance, new StringBuffer(), new FieldPosition(0));
		
		System.out.println(frm.parse(frm).doubleValue());
	}
}



Compiling Errors:

--------------------Configuration: DecimalFormat - j2sdk1.4.2_12 <Default> - <Default>--------------------
C:\Documents and Settings\Alex Lysenka\My Documents\Java\DecimalFormat\Format.java:7: cannot resolve symbol
symbol  : constructor DecimalFormat (java.lang.String)
location: class DecimalFormat
                DecimalFormat frm = new DecimalFormat("0.00");
                                    ^
C:\Documents and Settings\Alex Lysenka\My Documents\Java\DecimalFormat\Format.java:9: cannot resolve symbol
symbol  : class FieldPosition 
location: class Format
                frm.format(bankBalance, new StringBuffer(), new FieldPosition(0));
                                                                ^
C:\Documents and Settings\Alex Lysenka\My Documents\Java\DecimalFormat\Format.java:11: cannot resolve symbol
symbol  : method parse (DecimalFormat)
location: class DecimalFormat
                System.out.println(frm.parse(frm).doubleValue());
                                      ^
3 errors

Process completed.