Q&A

  • Incompatible Type 'Integer' and 'Real' 에러문제
table1.FieldByName('Pay').AsInteger := Result / 30 * 1000;

Result 는 정수형임

결과가 실수인데 정수로 바꾸는 함수를 모르겠네요

아시는 분 답변해주시면 감사하겠습니다.

1  COMMENTS
  • Profile
    안치봉 1999.04.23 03:14
    조봉성 wrote:

    > table1.FieldByName('Pay').AsInteger := Result / 30 * 1000;

    > Result 는 정수형임

    > 결과가 실수인데 정수로 바꾸는 함수를 모르겠네요

    > 아시는 분 답변해주시면 감사하겠습니다.





    Trunc truncates a real number to an integer.



    Unit



    System



    Category



    arithmetic routines



    function Trunc(X: Extended): Longint;



    Description



    The Trunc function truncates a real-type value to an integer-type value.

    X is a real-type expression. Trunc returns a Longint value that is the value of X rounded toward zero.

    If the truncated value of X is not within the Longint range, an EInvalidOp exception is raised.