Results 1 to 5 of 5

Thread: extended to string

  1. #1
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default extended to string

    Is there a function for extended to string? I'm using sin and cos in a function which returns the variable as extended, but the I want to writeln what that variable is, so I need to convert it to a string somehow.

  2. #2
    Join Date
    Jan 2007
    Location
    Toronto.
    Posts
    150
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    FloatToStr:

    SCAR Code:
    program New;
    var
      MyVar : Extended;
    begin
      MyVar := 0.4;
      WriteLn(FloatToStr(MyVar));
    end.

  3. #3
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Alright thanks. I found another way anyway I think

    InttoStr(round(Myvar));

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    2,984
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Yeah, but then you would write an int and not an extended anymore...
    Administrator's Warning:


  5. #5
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yea, thats okay though. I don't actually need the decimal places that sin returns.

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. String to Extended
    By A G E N T in forum OSR Help
    Replies: 1
    Last Post: 01-26-2008, 11:10 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
  •