function ausgab(wert)
{var ex=0;
if(wert==0) {strin="0"; return strin;}
if(wert<0.) {strin="-"; wert = Math.abs(wert);}
else strin="";
wsto = wert;
if(wert>=10){
while (wert>=10) {wert/=10; ex+=1;}
if (ex<5) {erg = Math.round(wsto*Math.pow(10,4-ex)) / Math.pow(10,4-ex); strin+=eval(erg);}
else {strin+=eval(Math.round(wert*10000)/10000); strin+="e+"; strin+=eval(ex);}}
else {if (wert>=0.999995) strin+=eval(Math.round(wert*10000)/10000);
else {if (wert>=0.0999995) {strin+=""; strin+=eval(Math.round(wert*100000)/100000);}
else {while(wert<1) {wert*=10; ex+=1;}
strin+=eval(Math.round(wert*10000)/10000); strin+="e-"; strin+=eval(ex); }}}
return strin;}

function ausfst(wert,stll)
//Ausgabe mit fester Kommastelle
{
  if(wert==0) {strin="0"; return strin;}
  strin=eval(Math.round(wert*Math.pow(10.,stll))/Math.pow(10.,stll));
  return strin;
}

function ausga(form,wert)
{
  var ex=0;
  st=1+form.stell.selectedIndex;
  if(wert==0) {strin="0"; return strin;}
  if(wert<0.) {strin="-"; wert = Math.abs(wert);}
  else strin="";
  wsto = wert;
  if(wert>=10){
    while (wert>=10) {wert/=10; ex+=1;}
    if (ex<st) {erg = Math.round(wsto*Math.pow(10,st-1-ex))/ Math.pow(10,st-1-ex); strin+=eval(erg);}
    else {strin+=eval(Math.round(wert*Math.pow(10,st-1))/Math.pow(10,st-1)); strin+="e+"; strin+=eval(ex);}}
  else {if (wert>=(1.0-5.0*Math.pow(10,-st-1))) strin+=eval(Math.round(wert*Math.pow(10,st-1))/Math.pow(10,st-1));
  else {if (wert>=(0.1-5.0*Math.pow(10,-st-2))) {strin+=""; strin+=eval(Math.round(wert*Math.pow(10,st))/Math.pow(10,st));}
  else {while(wert<1) {wert*=10; ex+=1;}
  strin+=eval(Math.round(wert*Math.pow(10,st-1))/Math.pow(10,st-1)); strin+="e-"; strin+=eval(ex); }}}
  return strin;
}

