Limit character after point in Java
===

How can I limit number of characters after point (which is displayed in my  TextView)
It would be greate to see 2 ways: in java and ectually in TextView XML (if it possible)
Thanks!

    
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        inivVars();     
    }
    private void inivVars(){...}

	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch(v.getId()){
		case R.id.bCount:
		
			try{
			checkT1 = et1.getText().toString();
			checkT2 = et2.getText().toString();
			checkK1 = ek1.getText().toString();
		  
		    det1 = Float.parseFloat(checkT1);
			det2 = Float.parseFloat(checkT2);
			dek1 = Float.parseFloat(checkK1);
			float x = det2/(det1/100)/100*dek1;
			String sx = String.valueOf(x);
			text.setText(sx);
			text.setTextColor(Color.BLUE);
			
			}catch(Exception e){
				Toast t = Toast.makeText(CivilProtectActivity.this, "enter all values or use suitable '.'", Toast.LENGTH_LONG);
				t.show();
				
			}
			
			break;
		case R.id.bHide:
			InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
			imm.hideSoftInputFromWindow(et1.getWindowToken(), 0);
			et1.setText("");
			et2.setText("");
			ek1.setText("");
			text.setText("");
			
			break;
		}}}
and TextView XML which displays data

     <TextView
        android:id="@+id/tvShowA"
        android:layout_width="95dp"
        android:layout_height="95dp"
        android:textSize="22dp"
        android:hint="X"
        android:background="@drawable/sun"
        android:gravity="center"
        /> 
