From c62059c0f40127a3d567e2cc503f970ca1581c3f Mon Sep 17 00:00:00 2001 From: hunicus <93150691+hunicus@users.noreply.github.com> Date: Wed, 7 Dec 2022 00:03:57 -0500 Subject: [PATCH] Fix hexadecimal conversion to show leading zeros. Fixes #2805. --- frontend/src/app/shared/pipes/decimal2hex/decimal2hex.pipe.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/shared/pipes/decimal2hex/decimal2hex.pipe.ts b/frontend/src/app/shared/pipes/decimal2hex/decimal2hex.pipe.ts index 3c99cec0d..6ccd4238b 100644 --- a/frontend/src/app/shared/pipes/decimal2hex/decimal2hex.pipe.ts +++ b/frontend/src/app/shared/pipes/decimal2hex/decimal2hex.pipe.ts @@ -5,6 +5,6 @@ import { Pipe, PipeTransform } from '@angular/core'; }) export class Decimal2HexPipe implements PipeTransform { transform(decimal: number): string { - return `0x` + decimal.toString(16); + return `0x` + ( decimal.toString(16) ).padStart(8, '0'); } }