Skip to content

Commit

Permalink
fix: formatting + spacing table header (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
atrincas authored Jan 17, 2025
1 parent 61c9c34 commit c2bccc6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function KeyCostsTable() {
<TableRow key={headerGroup.id}>
{headerGroup.headers.map((header) => {
return (
<TableHead key={header.id}>
<TableHead key={header.id} className="p-2">
{header.isPlaceholder ? null : (
<div
className={cn({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export function ScoredCardPrioritizationTable() {
<TableRow key={headerGroup.id}>
{headerGroup.headers.map((header) => {
return (
<TableHead key={header.id}>
<TableHead key={header.id} className="p-2">
{header.isPlaceholder ? null : (
<div
className={cn({
Expand Down
15 changes: 10 additions & 5 deletions client/src/lib/format.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ export const formatNumber = (
value: number,
options: Intl.NumberFormatOptions = {},
) => {
return Intl.NumberFormat("en-US", {
style: "decimal",
maximumFractionDigits: 2,
...options,
}).format(value);
return (
Intl.NumberFormat("en-US", {
style: "decimal",
maximumFractionDigits: 2,
...options,
})
.format(value)
// Removes trailing ".00" if present
.replace(/\.00$/, "")
);
};

/**
Expand Down

0 comments on commit c2bccc6

Please sign in to comment.