mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
Increasing trades.price decimal scale (#89)
* Changing trades.price to have a larger scale - a scale of 4 causes destructive rounding when calculating transaction cost; changes to the UI to allow for inputting and showing increased scale trade prices; test case
This commit is contained in:
@@ -48,14 +48,14 @@
|
||||
inline: true,
|
||||
placeholder: "100",
|
||||
value: if options[:value]
|
||||
sprintf("%.#{currency.default_precision}f", options[:value])
|
||||
sprintf("%.#{options[:precision].presence || currency.default_precision}f", options[:value])
|
||||
elsif form.object && form.object.respond_to?(amount_method)
|
||||
val = form.object.public_send(amount_method)
|
||||
sprintf("%.#{currency.default_precision}f", val) if val.present?
|
||||
sprintf("%.#{options[:precision].presence || currency.default_precision}f", val) if val.present?
|
||||
end,
|
||||
min: options[:min] || -99999999999999,
|
||||
max: options[:max] || 99999999999999,
|
||||
step: currency.step,
|
||||
step: options[:step] || currency.step,
|
||||
disabled: options[:disabled],
|
||||
data: {
|
||||
"money-field-target": "amount",
|
||||
|
||||
Reference in New Issue
Block a user