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
Damien Gerard
Le temps n'a pas d'importance. Seul le code est important
-- (f00ty)