Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-02

Stupid pascal question

6 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dalton Calford

I have been reading and searching all the various bits of documentation I can find but I can not discover a method of converting an ansistring to a real.

I was hoping for a function like Str2Real() or StrToReal() but I am having no luck.

I am using the latest stable version of lazarus and fpc.

Anyone know what unit I should include and where I can find any documentation for this?

best regards

Dalton

Reply by email

Marco Alvarado
to Dalton Calford

FloatToStr()

2008/2/29, Dalton Calford :

Show quoted text 21 lines
I have been reading and searching all the various bits of documentation I can find but I can not discover a method of converting an ansistring to a real. I was hoping for a function like Str2Real() or StrToReal() but I am having no luck. I am using the latest stable version of lazarus and fpc. Anyone know what unit I should include and where I can find any documentation for this? best regards Dalton _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Damien Gerard
to Dalton Calford: I have been reading and searching all the various bits of documentation I can find but I…

Le Feb 29, 2008 ? 8:23 PM, Dalton Calford a ?crit :

Show quoted text 13 lines
I have been reading and searching all the various bits of documentation I can find but I can not discover a method of converting an ansistring to a real. I was hoping for a function like Str2Real() or StrToReal() but I am having no luck. I am using the latest stable version of lazarus and fpc. Anyone know what unit I should include and where I can find any documentation for this?

May be you are looking for these functions :

Function StrToFloat(Const S : String) : Extended;
Function StrToFloat(Const S : String; Const FormatSettings:
TFormatSettings) : Extended;
Function StrToFloatDef(Const S: String; Const Default: Extended):
Extended;
Function StrToFloatDef(Const S: String; Const Default: Extended; Const
FormatSettings: TFormatSettings): Extended;
Function TryStrToFloat(Const S : String; Var Value: Single): Boolean;
Function TryStrToFloat(Const S : String; Var Value: Single; Const
FormatSettings: TFormatSettings): Boolean;
Function TryStrToFloat(Const S : String; Var Value: Double): Boolean;
Function TryStrToFloat(Const S : String; Var Value: Double; Const
FormatSettings: TFormatSettings): Boolean;
Function CurrToStr(Value: Currency): string;
function StrToCurr(const S: string): Currency;
function TryStrToCurr(const S: string;Var Value : Currency): Boolean;
function StrToCurrDef(const S: string; Default : Currency): Currency;

(uses SysUtils but not sure)

Show quoted text 8 lines
best regards Dalton _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Damien Gerard Le temps n'a pas d'importance. Seul le code est important -- (f00ty)

Reply by email

Mattias Gaertner
to Dalton Calford: I have been reading and searching all the various bits of documentation I can find but I…
Show quoted text 6 lines
I have been reading and searching all the various bits of documentation I can find but I can not discover a method of converting an ansistring to a real. I was hoping for a function like Str2Real() or StrToReal() but I am having no luck.

http://lazarus-ccr.sourceforge.net/docs/rtl/sysutils/strtofloat.html

I am using the latest stable version of lazarus and fpc. Anyone know what unit I should include and where I can find any documentation for this?

Mattias

Reply by email

Dalton Calford
to Burkhard Carstens: try StrToFloat or StrToFloatDef regards Burkhard

Thanks to all who replied.

Best Regards

Dalton

Burkhard Carstens wrote 17 lines
Am Freitag, 29. Februar 2008 20:23 schrieb Dalton Calford: > I have been reading and searching all the various bits of > documentation I can find but I can not discover a method of > converting an ansistring to a real. > > I was hoping for a function like Str2Real() or StrToReal() but I am > having no luck. try StrToFloat or StrToFloatDef regards Burkhard _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email