mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
calculations
This commit is contained in:
parent
8a8484deb3
commit
04e8352dd0
@ -38,12 +38,13 @@ export default function FormPricing({
|
|||||||
|
|
||||||
// Always update everything when price value changes
|
// Always update everything when price value changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
// with `weightOnDataToken` we assume it's measured against 1 OCEAN
|
||||||
|
const weightOnOcean = 1
|
||||||
const dtAmount =
|
const dtAmount =
|
||||||
(Number(oceanAmount) / Number(weightOnOcean) / price) *
|
(Number(oceanAmount) / weightOnOcean / price) * Number(weightOnDataToken)
|
||||||
Number(weightOnDataToken)
|
|
||||||
|
|
||||||
setFieldValue('dtAmount', dtAmount)
|
setFieldValue('dtAmount', dtAmount)
|
||||||
}, [oceanAmount, weightOnDataToken])
|
}, [price, oceanAmount, weightOnDataToken])
|
||||||
|
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user