Skip to content

Commit

Permalink
fix float, port
Browse files Browse the repository at this point in the history
  • Loading branch information
tmkontra committed Jul 26, 2021
1 parent aa6f046 commit b178973
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bullion-core/lib/bullion_core/table.ex
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ defmodule BullionCore.Table do
{owed, owes} = player_views(table)
|> Enum.map(fn {_, _, _, _, bank} -> bank end)
|> Enum.split_with(fn {owe?, value} -> owe? == :owed end)
owes = owes |> Enum.reduce(0, fn ({_, value}, acc) -> acc + value end) |> Decimal.from_float() |> Decimal.round(2)
owed = owed |> Enum.reduce(0, fn ({_, value}, acc) -> acc + value end) |> Decimal.from_float() |> Decimal.round(2)
owes = owes |> Enum.reduce(0.0, fn ({_, value}, acc) -> acc + value end) |> Decimal.from_float() |> Decimal.round(2)
owed = owed |> Enum.reduce(0.0, fn ({_, value}, acc) -> acc + value end) |> Decimal.from_float() |> Decimal.round(2)
{total_buys, total_out, owes, owed}
end

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
ports:
- "4000:4000"
environment:
- PORT=4001
- PORT=4000
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db/${POSTGRES_DB}
db:
container_name: "bullion-db"
Expand Down

0 comments on commit b178973

Please sign in to comment.