Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert Text to Decimal Number 1

Status
Not open for further replies.

George1111

Programmer
Aug 6, 2003
25
AU
I am at a loss how to do this

I want to convert a text field like "1.5" into a decimal field
which Delphi Pascal can process

The data will be processed in a system script in Ostendo (If that helps)

StrToInt is DEFINITELY NOT the answer

I just cannot find ANY reference on how to do this - have been hunting the web for 2 hours

H E L P !!

Thanks
 
Try something like
Code:
var
  realNumber: Double;     // or Single
begin
  ...
  realNumber := StrToFloat( '1234.5' );
  ...
end;

Andrew
Hampshire, UK
 
The JCL has several functions one of which is StrToFloatSafe which will handle numbers with decimal separators as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top