fix: apply formatTokenAmount to Total row and guard against NaN/Infinity

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-03 03:32:06 +00:00
parent 8f5910d30a
commit d00b78f338
2 changed files with 2 additions and 1 deletions

View file

@ -27,5 +27,6 @@ export function commaNumber(value: number): string {
/** Format a token amount with comma grouping and 2 decimal places (e.g. "1,234.56") */
export function formatTokenAmount(value: number): string {
if (!isFinite(value)) return '0.00';
return value.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
}

View file

@ -50,7 +50,7 @@
</div>
<div class="profit-stats-item profit-stats-total">
<div><b>Total</b></div>
<div>{{ taxPaidGes !== undefined && profit !== undefined ? total.toFixed(5) : '...' }} $KRK</div>
<div>{{ taxPaidGes !== undefined && profit !== undefined ? formatTokenAmount(total) : '...' }} $KRK</div>
</div>
</div>
</div>