Sign in Join
FPDoc Onlineexperiment

TJSONIniFile.ReadFloat function

Member of TJSONIniFilepublicIn unit JsonIni

Reads a floating-point value from the JSON ini file

Declaration

pascal
function ReadFloat(const Section: string; const Ident: string; 
 Default: Double): Double; override

Arguments

Section

The section name to read from

Ident

The key name to read

Default

Default value to return if key not found or conversion failed

Function result

The floating-point value or default if key not found or conversion failed

Description

ReadFloat reads a floating-point value from the specified section and key. If the stored value is a JSON number, it is converted to Double. If the stored value is a string, it attempts to parse it as a floating-point number using both localized and non-localized formats. If the key is not found or conversion fails, the Default value is returned.

See also

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