4.849753E-01
5.690675E+00
这样写表示什么??我有一个文本文件,里面都是象上面那样的数,我想把它转换为小数的形式 (不要带E的这种)
应如何转换

解决方案 »

  1.   

    var
      d:double;
    begin
     d:=strtofloat('4.849753E-01');
     showmessage(floattostr(d));
    end;
      

  2.   

    dinglinger
    这样就可以了啊 
    但是对的 不太明白 给你分了啊
      

  3.   

    Use StrToFloat to convert a string, S, to a floating-point value. S must consist of an optional sign (+ or -), a string of digits with an optional decimal point, and an optional mantissa. The mantissa consists of 'E' or 'e' followed by an optional sign (+ or -) and a whole number. Leading and trailing blanks are ignored.自己仔细看看前面这段文字吧。呵~~,你就明白了。The DecimalSeparator global variable or its TFormatSettings equivalent defines the character that is used as a decimal point. Thousand separators and currency symbols are not allowed in the string. If S doesn't contain a valid value, StrToFloat raises an EConvertError exception. The first form of StrToFloat is not thread-safe, because it uses localization information contained in global variables. The second form of StrToFloat, which is thread-safe, refers to localization information contained in the FormatSettings parameter. Before calling the thread-safe form of StrToFloat, you must populate FormatSettings with localization information. To populate FormatSettings with a set of default locale values, call GetLocaleFormatSettings.
      

  4.   

    看楼主要保留几位小数了,例如2位的话,可以这样变下
    i:= (int(4.849753E-01*100+0.5))/100;