Solution for Parse text as decimal and two digit floating point with comma as seprator
===

    


    This is working code work for parse edit text with comma as separator with 2 digit floating point values.For layout you need only a edit text which id u can take as in code.
Here one editTextChangeListener is present on which complete coding is placed
        private EditTexted = null;  
	private NumberFormat amountFormatter = null;  
	private boolean isUserInput = true;  
	double parsed;  
	int bool=0;  
	// String str="100000";  
	OnFocusChangeListener focuschanged;  

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		ed = (EditText) findViewById(R.id.edTest);
		ed.addTextChangedListener(new TextWatcher() {
			private String current = "";

			@Override
			public void onTextChanged(CharSequence s, int start, int before,
					int count) {

				System.out.println(s);
				if (s == null || s.equals("") || s.length() < 1) {

				} else {
					if (!s.toString().equals(current)) {

						ed.removeTextChangedListener(this);
						String str = s.toString();
						String formated;
						String cleanString = str.replaceAll("[$,A-Z a-z]", "");

						// NumberFormat numberFormat = new
						// DecimalFormat("#,###.00");
						System.out.println("cleaned..." + cleanString);

						double d = Double.parseDouble(cleanString);

						/* */

						// System.out.println( "amount without formatting: " + d
						// );
						// System.out.println( "amount with    formatting: " +
						// numberFormat.format(d) );
						// current = formated;
						System.out.println("now str was.." + str);
						if (str.contains("."))
						{
							String sas[] = cleanString.split("[.]");
							if (sas.length > 1) 
							{
								String floatThird=null,floatFirstSec;
								if(sas[1].length()<2){
									floatFirstSec = sas[1].substring(0);
									int intFloat = Integer.parseInt(floatFirstSec);
									System.out.println("float less then 2...<2"
											+ intFloat);
									bool=3;
									// ed.setText(sas[0]+"."+intFloat);
									String sass;
									if(intFloat==0)
									{
										 sass = sas[0] ;
										
									}else{
										 sass = sas[0] + "." + intFloat;
										
									}
								//	String sass = sas[0] + "." + intFloat;
									d = Double.parseDouble(sass);
									if (intFloat < 10) {
										ed.setSelection(sas[0].length() + 1);
									} else {
										ed.setSelection(sas[0].length() + 2);
									}
								}
								else if(sas[1].length()==2){
									floatFirstSec = sas[1].substring(0);
									int intFloat = Integer.parseInt(floatFirstSec);
									System.out.println("float less then 2...==2"
											+ intFloat);
									// ed.setText(sas[0]+"."+intFloat);
									String sass = sas[0] + "." + intFloat;
									bool=4;
									d = Double.parseDouble(sass);
									/*if (intFloat < 10) {
										ed.setSelection(sas[0].length() + 1);
									} else {*/
										ed.setSelection(sas[0].length() + 3);
									//}
								}
								
								else if (sas[1].length() > 2) 
								{
									bool=4;
									floatThird = sas[1].substring(2,3);
									System.out.println("value floating third"
											+ floatThird);
									floatFirstSec = sas[1].substring(0,
											2);
									int intFloat = Integer.parseInt(floatThird);
									int intFloatFirstSec = Integer
											.parseInt(floatFirstSec);
									if (intFloatFirstSec > 0)
									{
										if (intFloat > 5) 
										{
											intFloatFirstSec++;
										}
									} 
									else {
										intFloatFirstSec = intFloat;
									}
									// ed.setText(sas[0]+"."+intFloatFirstSec);
									String sass = sas[0] + "."
											+ intFloatFirstSec;
									d = Double.parseDouble(sass);
									if (intFloat < 10)
									{
										ed.setSelection(sas[0].length());
									} 
									else {
										ed.setSelection(sas[0].length() + 1);
									}
									// ed.setSelection(formated.length()-1);
								} 
								if (str.contains(".") && ( bool==4) && sas[1].length()>=1) {
									formated = new DecimalFormat("##,##.00")
											.format(d);

								}/*else if (str.contains(".") && (bool==4) && sas[1].length()>=1) {
									formated = new DecimalFormat("##,##.00")
									.format(d);

								}*/
								else if (str.contains(".") && floatThird==null) {
									formated = new DecimalFormat("##,##.0")
									.format(d);
									bool=1;

								} 
								
								else {
									formated = new DecimalFormat("##,##")
											.format(d);

								}
								
							} else {
								/*if (str.contains(".")) {
									formated = new DecimalFormat("##,##.00")
											.format(d);

								} else {*/
									formated = new DecimalFormat("##,##.")
											.format(d);
									bool=2;
								//}
								
							}
							/*if(bool==1){
								ed.setText(formated);
							}
							else if(bool==2){
								ed.setText(formated);
							}
							else if(bool==4){
								ed.setText(formated);
							}
							else{*/
								ed.setText(formated);
							//}
							ed.setSelection(formated.length());
						} 
						else {
							/*if (str.contains(".")) {
								formated = new DecimalFormat("##,##.00")
										.format(d);

							} else {*/
								formated = new DecimalFormat("##,##")
										.format(d);

							//}
							ed.setText(formated);
							ed.setSelection(formated.length());
						}

						// ed.setSelection(formated.length());
						ed.addTextChangedListener(this);
					} else {
						System.out.println("i m in else.");
					}
					/*
					 * str=s.toString();
					 * 
					 * NumberFormat numberFormat = new DecimalFormat("#,###");
					 * 
					 * //double d=Double.parseDouble(str); System.out.println(
					 * "amount without formatting: " +str ); System.out.println(
					 * "amount with    formatting: " + numberFormat.format(s) );
					 * 
					 * ed.setText(""+numberFormat.format(s));
					 */

				}
			}

	@Override
	public void beforeTextChanged(CharSequence s, int start, int count,
        	int after) {
	    // TODO Auto-generated method stub

	}
	@Override
	public void afterTextChanged(Editable s) {
		// TODO Auto-generated method stub

	}
     });
}
