From dff7cf39c411a6390351ab1224fd069f8a6568fa Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Tue, 30 Nov 2021 18:19:15 -0800 Subject: [PATCH] Match up calculations to the spreadsheet --- market-simulator/src/components/Simulator.vue | 39 +++++++++++++------ market-simulator/src/components/orders.ts | 3 +- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/market-simulator/src/components/Simulator.vue b/market-simulator/src/components/Simulator.vue index 8d61dee8..cc03c082 100644 --- a/market-simulator/src/components/Simulator.vue +++ b/market-simulator/src/components/Simulator.vue @@ -21,8 +21,8 @@ {{ entry.yesWeight || '' }} {{ entry.noWeight || '' }} {{ entry.prob }} - {{ entry.yesPayout }} - {{ entry.noPayout }} + {{ entry.yesPayout.value.toFixed(2) }} + {{ entry.noPayout.value.toFixed(2) }} @@ -31,14 +31,22 @@ diff --git a/market-simulator/src/components/orders.ts b/market-simulator/src/components/orders.ts index 8ef39962..547e6dce 100644 --- a/market-simulator/src/components/orders.ts +++ b/market-simulator/src/components/orders.ts @@ -43,7 +43,8 @@ const data = `1,9 10, ,10 10, -,10` +,10 +10,` // Parse data into Yes/No orders // E.g. `8,\n,1\n1,` =>