我用的是delphi7,怎么样将除出来的数值小数点第三位四舍五入呀??
我在线等哪位高手帮帮我!!!

解决方案 »

  1.   

    好象是Power(原数值, 小数位)
      

  2.   

    var
      F,F1: Double;
    begin
      F := 12.34678;
      F1 := Round(Trunc(F*1000)/10)/100; //=12.35
      ShowMessage(FloatToStr(F1));
    end;—————————————————————————————————
    宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
    —————————————————————————————————
      

  3.   

    给你一个函数:function FourOutFiveIn(xValue:Double; xpos:integer):Double;
    begin
      if xValue < 0 then
        Result := int( xValue * exp( xPos * ln(10)) - 0.5)  / exp( xPos * ln(10))
      else
        Result := int( xValue * exp( xPos * ln(10)) + 0.5)  / exp( xPos * ln(10));
    end;