> ## 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.

# Format number value

> Applies number formatting to the input. Several arguments can be used to get the desired result.

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>;
};

Applies number formatting to the input, so a raw number becomes a neatly formatted one with a fixed number of decimal places, your chosen decimal mark, and an optional separator between thousands. Use this when a target system expects prices or quantities written a specific way, for example `1,234.50` for English-language invoices or `1.234,50` for many European formats. The result is text, so it keeps exactly the formatting you chose, and the value is rounded to fit the number of decimals you set.

This documentation describes: [Schema](/schemas/mapper/format-number)

## Fields

<FormField property="decimals" label="Number of decimals" required>
  How many digits to show after the decimal mark. For example, `2` turns `1234.5` into something ending in `.50`. The value is rounded to fit, and `0` gives a whole number.
</FormField>

<FormField property="decimalPoint" label="Separator for the decimal point" required>
  The character placed before the decimal digits. Use `.` for English-style numbers or `,` for many European formats.
</FormField>

<FormField property="thousandSeparator" label="Separator for the thousands separator">
  The character placed between each group of three digits in the whole-number part, for example the `,` in `1,234`. Leave it empty for no grouping at all.
</FormField>

## Sample data

| Field                                 | Value |
| ------------------------------------- | ----- |
| Number of decimals                    | `2`   |
| Separator for the decimal point       | `.`   |
| Separator for the thousands separator | `,`   |

Input:

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

Output:

```json theme={null}
{ "price": "1,234.50" }
```

```json Configuration theme={null}
{
  "prototype": "format-number",
  "parameters": {
    "decimals": 2,
    "decimalPoint": ".",
    "thousandSeparator": ","
  }
}
```
