Example:

You buy 1 lot of EURUSD.
Account currency: EUR.
Leverage: 1:100.

<Margin> = 100,000 / 100 = 1,000 EUR

If your account currency differs from the base currency of the instrument, you have to convert the margin amount into the account currency at the rate when your position is opened.

Example:

You buy 1 lot of EURUSD.
Account currency: USD.
Margin in the base currency of the asset: 1,000 EUR.
Current EURUSD rate: 1.2345.

<Margin> = 1,000 * 1.2345 = 1,234.50 USD