istox 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 32b60e5cea8c89edc2c9d9a9b4a9aaefeb026351d68ed6898b578f04213f7e81
4
- data.tar.gz: e969dc0c25653d64d0de4173bd59178e3f2da8b080fe7db9d34f7c56b67bb791
3
+ metadata.gz: 177c19f4e1837c38552a01345f4df0ed0b6d75489c3ff7ac7cee4e6ae5300e9d
4
+ data.tar.gz: bc1e0d56a7c66ebbbb11f2408e8dfbbec8fad3bb056eafd08ca89aa3b7af712c
5
5
  SHA512:
6
- metadata.gz: 88109a86cc415878a19a461ed56252c42562fd44a40861eebe04f5a65a57c4b59df823851a047e59db49f78a5873e63eb99a27cf91f2e4a1c56646660b5f3e67
7
- data.tar.gz: 9106e4ba0fd8bc5a965fcee3d3e78f1c6cf89ab5f2dcb1c3cbd7762913d6c6382b73c0173985c5f358aca6c58e697bfb78574c7c2c1b88af1b8a2702e89b5aea
6
+ metadata.gz: 3b4c6ea1b0f4dade5ce454996d6d72c454560d641a4bba722385db12da19e8531bc6fcab904cb372b664ec3952047510942b92da16bf3ab3dcc28bbde685d603
7
+ data.tar.gz: 5d5e23ac455354401407c93507526fb616e4d7fba272e4883f7a142c86f0bff8c282101aec833b63ae810e90f914c8a273825306673de9c40f6e96908a6123fd
@@ -1,7 +1,7 @@
1
1
  module Istox
2
2
  class OrderBookPriceTime
3
3
  class << self
4
- def allocation(soft_cap, total_supply, investments)
4
+ def allocation(soft_cap, total_supply, investments, decimal_place: 2)
5
5
  # sort by token price desc, and id asc
6
6
  investments = investments.sort do |a, b|
7
7
  [b[:token_price], a[:id]] <=> [a[:token_price], b[:id]]
@@ -15,7 +15,7 @@ module Istox
15
15
  total_allocated = 0.0
16
16
  total_unallocated = 0.0
17
17
  total_investment = 0.0
18
- cutoff_price = ::Istox::FMath.round_up(::Istox::FMath.div(soft_cap, total_supply), 2)
18
+ cutoff_price = ::Istox::FMath.round_up(::Istox::FMath.div(soft_cap, total_supply), decimal_place)
19
19
  is_cutoff = false
20
20
 
21
21
  # return result immediately if no interest
data/lib/istox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: istox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siong Leng
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-09 00:00:00.000000000 Z
11
+ date: 2021-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: amazing_print