> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cast: Float

> Converts a value into a float (1.00, 2.05, 10.50, etc).

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Converts a value into a float (1.00, 2.05, 10.50, etc). Use this when a decimal number arrives as text, such as a price of `"19.99"` from a CSV file or an API, and the target system needs a real number it can calculate with rather than a piece of text. It reads the number from the start of the value and keeps the decimal part, so `"19.99"` becomes `19.99` and `"10.50 EUR"` becomes `10.5`. A value that does not start with a number becomes `0`.

This documentation describes: [Schema](/schemas/mapper/cast-float)

## Fields

This mapper has no settings to configure. Point it at the value you want to convert and it does the rest.

## Sample data

| Field         | Value |
| ------------- | ----- |
| (no settings) |       |

Input:

```json theme={null}
{
    "price": "19.99"
}
```

Output:

```json theme={null}
{
    "price": 19.99
}
```

```json Configuration theme={null}
{
  "prototype": "cast-float",
  "parameters": {}
}
```
