---
url: /flow/guide/scripting-reference/classes/field/field.asfloat.md
---

# Field.AsFloat

## Declaration

`property AsFloat: double`

### Example

```pascal
procedure OnMapEvent(var Value:Variant);
begin
  Value := Dataset['myfield'].AsFloat; //the value of myfield is returned as a Float
end;
```

## Description

Returns the value of the Field object as a [Float (Double, Extended, Currency)](/flow/guide/scripting-reference/data-types/float). If the field is null then zero will be returned.

It is recommended that you use this property when referencing Float type fields. This will help you avoid issues with null values causing arithmetic operators and numeric functions to fail.

If you need to convert an Float type field to a string you can safely use the [Field.AsString](/flow/guide/scripting-reference/classes/field/field.asstring) property. Alternatively use a [Conversion](/flow/guide/scripting-reference/functions/conversion/) or [Formatting](/flow/guide/scripting-reference/functions/formatting/) function and this AsFloat property.
