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:
Michael Studman
2025-10-22 03:22:24 +11:00
committed by GitHub
parent 3aea1513d1
commit ea7ce13a7d
6 changed files with 50 additions and 5 deletions

2
db/schema.rb generated
View File

@@ -789,7 +789,7 @@ ActiveRecord::Schema[7.2].define(version: 2025_08_08_143007) do
create_table "trades", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.uuid "security_id", null: false
t.decimal "qty", precision: 19, scale: 4
t.decimal "price", precision: 19, scale: 4
t.decimal "price", precision: 19, scale: 10
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "currency"