Fix hexadecimal conversion to show leading zeros.

Fixes #2805.
This commit is contained in:
hunicus 2022-12-07 00:03:57 -05:00
parent 5ff5275b36
commit c62059c0f4
No known key found for this signature in database
GPG key ID: 24837C51B6D81FD9

View file

@ -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');
}
}