Code example for DecimalFormat

Methods: applyPattern, format

0
	} 
 
	public static String CentsToEuroString(int cents) {
		NumberFormat nf = NumberFormat.getNumberInstance(Locale.getDefault());
		DecimalFormat df = (DecimalFormat) nf;
		df.applyPattern("##0.00");
		String euroString = df.format((double) cents / 100.0);
		// XXX: Can't get the , and . right. Not even after forcing a locale 
		// like GERMANY 
		euroString = euroString.replace('.', ',');
		return euroString;
	} 
}