fix(backend): Round heatmap values to 2 decimal places
Prevents long decimal numbers like 37.805740635007325 from displaying in the UI. Now shows clean values like 37.81. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -824,10 +824,11 @@ export class StateQueryService {
|
|||||||
|
|
||||||
const result = await this.pool.query(query, params);
|
const result = await this.pool.query(query, params);
|
||||||
// Parse numeric values from strings (PostgreSQL returns bigint as string)
|
// Parse numeric values from strings (PostgreSQL returns bigint as string)
|
||||||
|
// Round to 2 decimal places for display
|
||||||
return result.rows.map((row: any) => ({
|
return result.rows.map((row: any) => ({
|
||||||
state: row.state,
|
state: row.state,
|
||||||
stateName: row.stateName,
|
stateName: row.stateName,
|
||||||
value: row.value !== null ? parseFloat(row.value) : 0,
|
value: row.value !== null ? Math.round(parseFloat(row.value) * 100) / 100 : 0,
|
||||||
label: row.label,
|
label: row.label,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user