Match amounts (FX drift)
match_amounts_with_fx_driftDetermines whether two amounts in different currencies match by converting one at the supplied FX rate and checking if the percentage difference falls within tolerance. Uses exact decimal arithmetic.
Instructions
Compare two amounts in different currencies, converting one via a supplied FX rate and matching if the percentage difference is within tolerance. Uses exact decimal arithmetic.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fx_rate | Yes | Units of currency_a per one unit of currency_b (e.g. an EUR/USD quote of 1.08 is USD per EUR). | |
| amount_a | Yes | Amount denominated in currency_a. | |
| amount_b | Yes | Amount denominated in currency_b. | |
| currency_a | Yes | ISO 4217 code of amount_a. | |
| currency_b | Yes | ISO 4217 code of amount_b. | |
| tolerance_pct | No | Max percentage difference still counted as a match. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||