1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-06-30 22:01:44 +02:00

calculations

This commit is contained in:
Matthias Kretschmann 2020-10-26 16:00:19 +01:00
parent 8a8484deb3
commit 04e8352dd0
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -38,12 +38,13 @@ export default function FormPricing({
// Always update everything when price value changes
useEffect(() => {
// with `weightOnDataToken` we assume it's measured against 1 OCEAN
const weightOnOcean = 1
const dtAmount =
(Number(oceanAmount) / Number(weightOnOcean) / price) *
Number(weightOnDataToken)
(Number(oceanAmount) / weightOnOcean / price) * Number(weightOnDataToken)
setFieldValue('dtAmount', dtAmount)
}, [oceanAmount, weightOnDataToken])
}, [price, oceanAmount, weightOnDataToken])
const tabs = [
{