Implemented strtofloat

This commit is contained in:
michael 1999-06-19 07:39:43 +00:00
parent e6da269609
commit aae9265b5c
3 changed files with 25 additions and 3 deletions

View File

@ -40,6 +40,7 @@ Const
SInvalidDrive = 'Invalid drive specified';
SInvalidFileHandle = 'Invalid file handle';
SInValidFileName = 'Invalid filename';
SInvalidFloat = '"%s" is an invalid float';
SInvalidFormat = 'Invalid format specifier : "%s"';
SInvalidInput = 'Invalid input';
SInvalidInteger = '"%s" is an invalid integer';
@ -51,7 +52,10 @@ Const
SUnKnownRunTimeError = 'Unknown Run-Time error : %3.3d';
{
$Log$
Revision 1.5 1998-10-10 09:53:09 michael
Revision 1.6 1999-06-19 07:39:46 michael
Implemented strtofloat
Revision 1.5 1998/10/10 09:53:09 michael
Added assertion handling
Revision 1.4 1998/10/03 15:08:04 florian

View File

@ -880,6 +880,17 @@ begin
Result:=Buffer;
end;
function StrToFloat(Value: string): Extended;
var Error: word;
begin
Val(Value, result, Error);
if Error <> 0 then raise
EConvertError.createfmt(SInValidFLoat,[Value]);
end ;
Function FloatToStr(Value: Extended): String;
Begin
Result := FloatToStrF(Value, ffGeneral, 15, 0);
@ -1130,7 +1141,10 @@ const
{
$Log$
Revision 1.21 1999-06-05 20:47:03 michael
Revision 1.22 1999-06-19 07:39:44 michael
Implemented strtofloat
Revision 1.21 1999/06/05 20:47:03 michael
+ Final fixes: RightStr
Revision 1.20 1999/05/31 20:50:45 peter

View File

@ -80,6 +80,7 @@ Function StrLFmt(Buffer : PCHar; Maxlen : Cardinal;Fmt : PChar; Const args: Arra
Procedure FmtStr(Var Res: String; Const Fmt : String; Const args: Array of const);
Function FloatToStrF(Value: Extended; format: TFloatFormat; Precision, Digits: Integer): String;
Function FloatToStr(Value: Extended): String;
Function StrToFloat(Value : String) : Extended;
Function FloatToText(Buffer: PChar; Value: Extended; format: TFloatFormat; Precision, Digits: Integer): Longint;
{==============================================================================}
@ -92,7 +93,10 @@ function BCDToInt(Value: integer): integer;
{
$Log$
Revision 1.7 1999-05-28 20:08:21 michael
Revision 1.8 1999-06-19 07:39:43 michael
Implemented strtofloat
Revision 1.7 1999/05/28 20:08:21 michael
* too may fixes to list
Revision 1.6 1999/02/28 13:17:36 michael