1

How can i convert pascal string to double?

1 Answer 1

2

Like this:

Val(YourString, YourDouble, ErrorCode);

ErrorCode (which is Integer) is needed to know if the conversion was successful.

Hope it helps :)

Sign up to request clarification or add additional context in comments.

4 Comments

Did you understand my example?
Actually, in Turbo Pascal it is a word, not an integer :-)
@Marco, hmmm... Turbo Pascal - I taught it for like 12 years since 1990 :) Actually, you can use either Word or Integer. And for those of you who loved TP, there's FreePascal now, and yes, it's open source.
itsols: in FPC it is overloaded. And yes I do know FPC freepascal.org/aboutus.var (scroll down to end) :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.