Results 1 to 3 of 3

Thread: changing Extended into Integer

  1. #1
    Join Date
    Jan 2007
    Location
    BC, Canada
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    changing Extended into Integer

    Im have troubles. I cant get the value of an extended variable to become a integer. im using the "FindDeformedBitmapToleranceRotationIn" I want the angle and accuracy to be writen out. and this is simplified version of what i thought would work but it doesnt.

    SCAR Code:
    program New;
    var
    a: Extended;
    b: integer;
    begin
      a:=0.75636789;
      Round(a*100);
      b:=a;
      writeln(IntToStr(b));
    end.

  2. #2
    Join Date
    Aug 2006
    Location
    London
    Posts
    2,021
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program New;
    var
    a: Extended;
    b: integer;
    begin
      a:=0.75636789;
      b:=Round(a*100);
      writeln(IntToStr(b));
    end.

    round returns a value, you need to assign it somewhere

    you can also do FloatToStr(e:extended):string;
    Join the Official SRL IRC channel. Learn how to Here.

  3. #3
    Join Date
    Jan 2007
    Location
    BC, Canada
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks a bunch.
    heres what i changed it to.

    program New;
    var
    a: Extended;

    begin
    a:=0.75636789;
    a:=a*100;
    Writeln(FloatToStr(round(a)))

    end.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. function RoundDec(number: extended; decimals: integer): extended
    By mixster in forum Research & Development Lounge
    Replies: 8
    Last Post: 03-22-2008, 01:09 PM
  2. Extended to integer
    By cathering_ in forum OSR Help
    Replies: 2
    Last Post: 08-18-2007, 03:58 AM
  3. function SendKeyboard(FKey:Integer; Text:String): Integer;
    By Daniel in forum Research & Development Lounge
    Replies: 4
    Last Post: 07-18-2007, 04:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •