Skip to content

Commit 7b5f0a0

Browse files
StragaSeveraJacobPlaster
authored andcommitted
Fix warnings from Big Decimal
1 parent f9c8248 commit 7b5f0a0

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

lib/models/funding_offer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ def to_new_order_packet
3838
data = {
3939
:type => @type,
4040
:symbol => @symbol,
41-
:amount => BigDecimal.new(@amount, 8).to_s,
42-
:rate => BigDecimal.new(@rate, 8).to_s,
41+
:amount => BigDecimal(@amount, 8).to_s,
42+
:rate => BigDecimal(@rate, 8).to_s,
4343
:period => 2
4444
}
4545
if !@flags.nil?

lib/models/order.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def to_new_order_packet
173173
:cid => cid,
174174
:symbol => @symbol,
175175
:type => @type,
176-
:amount => BigDecimal.new(@amount, 8).to_s,
176+
:amount => BigDecimal(@amount, 8).to_s,
177177
:flags => @flags || 0,
178178
:meta => @meta
179179
}
@@ -184,14 +184,14 @@ def to_new_order_packet
184184
data[:lev] = @lev
185185
end
186186

187-
data[:price] = BigDecimal.new(@price, 5).to_s if !@price.nil?
188-
data[:price_trailing] = BigDecimal.new(@price_trailing, 5).to_s if !@price_trailing.nil?
187+
data[:price] = BigDecimal(@price, 5).to_s if !@price.nil?
188+
data[:price_trailing] = BigDecimal(@price_trailing, 5).to_s if !@price_trailing.nil?
189189

190190
if !@price_aux_limit.nil?
191191
if is_oco
192-
data[:price_oco_stop] = BigDecimal.new(@price_aux_limit, 5).to_s
192+
data[:price_oco_stop] = BigDecimal(@price_aux_limit, 5).to_s
193193
else
194-
data[:price_aux_limit] = BigDecimal.new(@price_aux_limit, 5).to_s
194+
data[:price_aux_limit] = BigDecimal(@price_aux_limit, 5).to_s
195195
end
196196
end
197197

lib/rest/v2/funding.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def close_funding(funding)
7878
# @return [Array] Raw notification
7979
###
8080
def submit_funding_auto(currency, amount, period, rate='0', status=1)
81-
dec_amount = BigDecimal.new(amount, 8).to_s
81+
dec_amount = BigDecimal(amount, 8).to_s
8282
payload = { :status => status, :currency => currency, :amount => dec_amount, :period => period, :rate => rate }
8383
authenticated_post("auth/w/funding/auto", params: payload).body
8484
end

0 commit comments

Comments
 (0)