I have a column in my Postgres Database named “adjust_expense_from_income” data_type Decimal, I have retrieved the card details by triggering the function
cards = GameOfFortune.Repo.all(query)
which provides me all the cards as I need. In the template view, I have to check the “adjust_expense_from_income” if it is zero then show different edit links else show another edit link. But it is always going to If condition and not in the else condition. Out of 10 rows in my cards 7 rows contain value as zero for the column name " adjust_expense_from_income" and rest 3 have “adjust_expense_from_income” > zero but it not working as I expect why?
Below is the code of my view
<%= if card.adjust_expense_from_income >0 do %> <%= link "Edit", to: Routes.admin_path(@conn, :edit_debt_card_adjust_income,card.id), class: "" %> <% else %> <%= link "Edit", to: Routes.admin_path(@conn, :edit_debt_card_single,card.id), class: "" %> <% end %>