Code example for Formatter

Methods: formattoString

0
		return total;
	} 
 
	private String formatAsMoney(double tip) {
		StringBuilder sb = new StringBuilder();
		Formatter formatter = new Formatter(sb, Locale.US);
		Formatter result = formatter.format("$%(,.2f", tip);
		return result.toString();
	} 
 
	public void goToMain(View view) {
		setContentView(R.layout.main);
	} 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE