Numscript
Requires flag: experimental-get-amount-function
Returns the numeric amount part of a monetary value.
Numscript
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