refactor: use Number.parseInt/Number.isNaN for numeric parsing across API and UI

Co-authored-by: Genie <genie@cosine.sh>
This commit is contained in:
Praveen Thirumurugan
2025-12-27 20:22:56 +00:00
committed by Genie
parent 01737528aa
commit beb4ce46f1
4 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -40,8 +40,8 @@ export default function ModelBreakdown({ models }: ModelBreakdownProps) {
<td style={styles.td}>
<strong>{model.model}</strong>
</td>
<td style={styles.td}>{parseInt(model.request_count).toLocaleString()}</td>
<td style={styles.td}>{parseInt(model.total_tokens).toLocaleString()}</td>
<td style={styles.td}>{Number.parseInt(model.request_count).toLocaleString()}</td>
<td style={styles.td}>{Number.parseInt(model.total_tokens).toLocaleString()}</td>
<td style={styles.td}>${parseFloat(model.total_cost).toFixed(4)}</td>
<td style={styles.td}>{Math.round(parseFloat(model.avg_response_time))}ms</td>
</tr>
+2 -2
View File
@@ -39,8 +39,8 @@ export default function TrendsChart({ trends }: TrendsChartProps) {
day: 'numeric',
hour: '2-digit',
}),
requests: parseInt(trend.requests),
tokens: parseInt(trend.tokens),
requests: Number.parseInt(trend.requests),
tokens: Number.parseInt(trend.tokens),
cost: parseFloat(trend.cost),
responseTime: Math.round(parseFloat(trend.avg_response_time)),
}));