D
D
developerrr2015-10-20 14:50:51
JavaScript
developerrr, 2015-10-20 14:50:51

Can someone tell me the correct formula?

I have an object of the form:

[{'name' : 'usd',
'rate' : 61,49},
{'name' : 'eur',
'rate' : 69,8},
{'name' : 'gbp',
'rate' : 95,05},
{'name' : 'chf',
'rate' : 64,43},
{'name' : 'kzt',
'rate' : 0,22}]

That is, the abbreviation of the currency and the exchange rate in relation to the Russian ruble.
If the site selects chf=>kzt , then you need to display the chf to kzt exchange rate based on the data that is in the object. Please tell me the correct formula.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
Cat Anton, 2015-10-20
@developerrr

(chf / kzt) = (chf / rub) / (kzt / rub)

D
Dmitry Kovalsky, 2015-10-20
@dmitryKovalskiy

Let's figure out the formula. you have chf/rub and kzt/rub. If you divide one by the other - chf/rub * rub/kzt = chf/kzt

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question