Sign in Join
FPDoc Onlineexperiment

ArgToFloat function

In unit fpExprPars

Convert argument to float value

Declaration

pascal
function ArgToFloat(Arg: TFPExpressionResult): TExprFloat

Arguments

Arg

Expression argument to convert

Function result

Returns float representation of argument

Description

This utility function converts an TFPExpressionResult argument to a floating-point value. It handles conversion from various result types including integer, currency, and string representations to the standard TExprFloat type.

The function is primarily used internally by mathematical operations and built-in functions that require floating-point operands. It provides type safety by ensuring consistent conversion behavior across different numeric types.

If the argument cannot be converted to a valid floating-point value, appropriate error handling is performed to maintain expression evaluation integrity.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.