From 9309de5c2c733de664c3abf207c0073c88462bfc Mon Sep 17 00:00:00 2001 From: Mike Bryant Date: Wed, 1 Apr 2020 00:23:02 +0100 Subject: [PATCH] fix: Rate calculation is based on ceiling not rounding --- js/scripts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/scripts.js b/js/scripts.js index 748d42f..5e8469e 100644 --- a/js/scripts.js +++ b/js/scripts.js @@ -1,9 +1,9 @@ function minimum_rate_from_given_and_base(given_price, buy_price) { - return (given_price - 0.5) / buy_price; + return (given_price - 1) / buy_price; } function maximum_rate_from_given_and_base(given_price, buy_price) { - return (given_price + 0.5) / buy_price; + return given_price / buy_price; } function* generate_pattern_0_with_lengths(given_prices, high_phase_1_len, dec_phase_1_len, high_phase_2_len, dec_phase_2_len, high_phase_3_len) {