From e294531c25572a6112115e69c5db0062db77c7b3 Mon Sep 17 00:00:00 2001 From: Yin Zhang Date: Fri, 12 Apr 2024 17:31:08 -0700 Subject: [PATCH] Increase precision of utils in op profile from 1 decimal point to 2 PiperOrigin-RevId: 624338266 --- frontend/app/common/utils/utils.ts | 4 ++-- .../op_profile/op_profile_common.scss | 23 +++++++++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/frontend/app/common/utils/utils.ts b/frontend/app/common/utils/utils.ts index e2d533afc..e49cc640e 100644 --- a/frontend/app/common/utils/utils.ts +++ b/frontend/app/common/utils/utils.ts @@ -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)}%`; } } diff --git a/frontend/app/components/op_profile/op_profile_common.scss b/frontend/app/components/op_profile/op_profile_common.scss index d18997dbc..8933df4ca 100644 --- a/frontend/app/components/op_profile/op_profile_common.scss +++ b/frontend/app/components/op_profile/op_profile_common.scss @@ -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, @@ -87,6 +100,11 @@ font-size: smaller; } +.wasted, +.wasted-header { + width: 8%; +} + .name-header, .name { display: inline-block; @@ -96,13 +114,14 @@ word-break: break-all; } -.name { +.name, +.provenance { text-align: left; } .provenance-header, .provenance { - width: 20%; + width: 10%; } .utilization-header,