How would calculate the exchange rate of Bitcoin GBP

0 votes

I've got an API that returns the value of USD/Bitcoin & USD/GBP.

{"USDBITCOIN":"4251.27", "USDGBP":"0.758659"}


To calculate the exchange rate of GBP/Bitcoin, I simply divide the value of the GBP by Bitcoin, because they are both USD based.

How would calculate the exchange rate of Bitcoin/GBP? It may be really simple, but it's really baffling me. I've got the below to calculate

app.js

xOfy(unit, value) { return unit / value; } yOfX(unit, value) { return unit * value; } xOfy(gbp, bitcoin) // 0.00018 yOfx(bitcoin, gbp) // 3225.26

Apr 7, 2022 in Blockchain by Soham
• 9,710 points
508 views

1 answer to this question.

0 votes

You simply divide 1 by the resulting value:

1 / (USDGBP * USDBITCOIN)

In this case, that'd be:

1 / (0.758659 * 4251.27) = 0.0003100521146296338

The 1 itself comes from the fact that 4251.27 USD is how much 1 Bitcoin is worth.

answered Apr 11, 2022 by Rahul
• 9,680 points

Related Questions In Blockchain

0 votes
1 answer

How to get the number of tokens in the Bitcoin network?

This information can easily be calculated by ...READ MORE

answered Aug 31, 2018 in Blockchain by Christine
• 15,790 points
1,160 views
0 votes
1 answer

Currency Conversion using PHP

 An example of converting EUR to USD ...READ MORE

answered Mar 24, 2022 in Blockchain by Rahul
• 9,680 points
501 views
0 votes
1 answer

bitcoin to currency converter and it's reverse in php

Ok, you can get the value by ...READ MORE

answered Mar 31, 2022 in Blockchain by Rahul
• 9,680 points
766 views
0 votes
1 answer

Currency Conversion using PHP

Please find below an example of converting ...READ MORE

answered Apr 6, 2022 in Blockchain by Soham
• 9,710 points
928 views
0 votes
1 answer

bitcoin to currency converter and it's reverse in php

Ok, you can get the value by ...READ MORE

answered Apr 7, 2022 in Blockchain by Aditya
• 7,680 points
1,701 views
0 votes
1 answer
0 votes
1 answer

Where does Hyperledger fabric store the public key and private key of the user?

It signs the transaction (eg. initiated by ...READ MORE

answered Mar 24, 2022 in Blockchain by Rahul
• 9,680 points
611 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP