Skip to content

Commit

Permalink
Display -- placeholder if no cost is set, also fix to 2 decimals
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwijos committed Jan 13, 2024
1 parent d4e5840 commit 4af84cb
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/routes/(protected)/admin/users/trips/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,18 @@
? `~${calculateTimeDifference(trip.start_time, dateNow)}`
: calculateTimeDifference(trip.start_time, trip.end_time)}</td
>
<td class="px-6 py-4 table-cell-fit text-right">{trip.start_cost} kr </td>
<td class="px-6 py-4 table-cell-fit text-right">{trip.var_cost} kr </td>
<td class="px-6 py-4 table-cell-fit text-right">{trip.park_cost} kr </td>
<td class="px-6 py-4 table-cell-fit text-right">{trip.total_cost} kr </td>
<td class="px-6 py-4 table-cell-fit text-right"
>{trip.start_cost ? `${trip.start_cost} kr` : '--'}</td
>
<td class="px-6 py-4 table-cell-fit text-right"
>{trip.var_cost ? `${trip.var_cost.toFixed(2)} kr` : '--'}</td
>
<td class="px-6 py-4 table-cell-fit text-right"
>{trip.park_cost ? `${trip.park_cost} kr` : '--'}</td
>
<td class="px-6 py-4 table-cell-fit text-right"
>{trip.total_cost ? `${trip.total_cost.toFixed(2)} kr` : '--'}
</td>
</tr>
{/each}
{/if}
Expand Down

0 comments on commit 4af84cb

Please sign in to comment.