public String gerundet(double wert, int stellen){ int i =0; double merker =0.00; merker =wert; String muster =""; while (merker>0){ merker/=10; muster= muster + "#"; } muster= muster + "."; for (i=0;i<stellen;i++){ muster= muster + "#"; } DecimalFormat formatierer =new DecimalFormat(muster); return (formatierer.format(wert));}