Code example for DecimalFormat

Methods: setDecimalSeparatorAlwaysShown

0
	private boolean hasFractionalPart;
 
	private EditText et;
 
	public NumberTextWatcher(EditText et) {
		df = new DecimalFormat("#,###.##");
		df.setDecimalSeparatorAlwaysShown(true);
		dfnd = new DecimalFormat("#,###");
		this.et = et;
		hasFractionalPart = false;
	} 
 
	@SuppressWarnings("unused") 
	private static final String TAG = "NumberTextWatcher";
 
	@Override 
	public void afterTextChanged(Editable s) {
		et.removeTextChangedListener(this);
 
		try { 
			int inilen, endlen;