# get_amount

Source: https://docs.formance.com/v3.2/modules/numscript/reference/get-amount

Stack: v3.2

Requires flag: `experimental-get-amount-function`

This is a feature of the experimental Numscript interpreter. To run it through the API, set `runtime: experimental-interpreter` in the transaction request body (the default is `machine`) and enable the relevant feature flag. See [Selecting an Interpreter](https://docs.formance.com/v3.2/modules/numscript/interpreter) for per-feature availability.

Returns the numeric amount part of a monetary value.

```numscript
#![feature("experimental-mid-script-function-call", "experimental-get-amount-function")]
vars {
  monetary $payment
  number $amount = get_amount($payment)
}

send $payment (
  source = @world
  destination = @users:1234
)

set_tx_meta("amount", $amount)
```

With `$payment = [EUR/2 5000]`, `$amount` resolves to `5000`.

## Use cases

- Store the amount of a dynamic monetary variable in transaction metadata
- Compute fees or splits based on the amount
- Log transaction amounts independently of the asset
