Skip to content

Commit

Permalink
Increase precision of utils in op profile from 1 decimal point to 2
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 624338266
  • Loading branch information
zzzaries authored and copybara-github committed Apr 13, 2024
1 parent 55ed9c7 commit fd8bd17
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
4 changes: 2 additions & 2 deletions frontend/app/common/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ export function percent(fraction: number, defaultValueIfNull = '-'): string {
if (fraction < 0.00001) {
return '0.0%';
} else {
// Round to 1 decimal place.
return `${(fraction * 100).toFixed(1)}%`;
// Round to 2 decimal place.
return `${(fraction * 100).toFixed(2)}%`;
}
}

Expand Down
21 changes: 20 additions & 1 deletion frontend/app/components/op_profile/op_profile_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@
cursor: pointer;
}

// set left margin of 16px to match leading span for each cell (for aria-label)
.time-header,
.wasted-header,
.hbmFraction-header,
.name-header,
.provenance-header,
.utilization-hader,
.hbmUtilization-header,
.utilization-header,
.hbmUtilization-header {
margin-left: 16px;
}

.time-header,
.wasted-header,
.hbmFraction-header,
Expand Down Expand Up @@ -87,6 +100,11 @@
font-size: smaller;
}

.wasted,
.wasted-header {
width: 8%;
}

.name-header,
.name {
display: inline-block;
Expand All @@ -96,7 +114,8 @@
word-break: break-all;
}

.name {
.name,
.provenance {
text-align: left;
}

Expand Down

0 comments on commit fd8bd17

Please sign in to comment.