Skip to content

Commit

Permalink
Improved cryptoAssetTile value printing
Browse files Browse the repository at this point in the history
Print "-" (meaning N/A) in case of there is nothing to print(zero values) and aligned the format for better visibility
  • Loading branch information
KnightChaser committed Jun 2, 2024
1 parent e7a64cf commit 1a2b64f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions frontend/src/routes/user/cryptoAssetTile.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,17 @@
</tr>
<tr>
<td class="pr-2 font-medium">Entry Price</td>
<td class="text-right">{@html formatCurrency(averageUnitPrice)}</td>
<td class="text-right">{@html averageUnitPrice !== 0 ? formatCurrency(averageUnitPrice) : '-'}</td>
</tr>
<tr>
<td class="pr-2 font-medium">Current Price</td>
<td class="text-right">{@html formatCurrency(currentPrice)}</td>
<td class="text-right">{@html currentPrice !== 0 ? formatCurrency(currentPrice) : '-'}</td>
</tr>
<tr>
<td class="pr-2 font-medium">Profit</td>
<td class="text-right">{@html formatCurrency(profit)}<br>({profitRate}%)</td>
<td class="text-right">{@html profit !== 0 ? formatCurrency(profit) : '-'}<br>
{profitRate !== 0 ? '(' + profitRate.toString() + '%)' : ''}
</td>
</tr>
</table>
</div>
Expand Down

0 comments on commit 1a2b64f

Please sign in to comment.