Formula for currency converter

How can i accomplish to create a ui with formula of exchange rate. Where when one input is filled another input shows the amount which is converted and vice versa. Just like an exchange rate app.

See attached example.

Anyone.?