fromBCD

Converts BCD value into decimal format

ushort
fromBCD
(
ushort bcd
)

Return Value

Type: ushort

decimal value

Examples

1 0.fromBCD().shouldEqual(0);
2 
3 (0x22).fromBCD().shouldEqual(22);
4 (34).fromBCD().shouldEqual(22);
5 // 17bcd
6 (0b0001_0111).fromBCD().shouldEqual(17);
7 295.fromBCD().shouldEqual(127);
8 39_321.fromBCD().shouldEqual(9_999);
9 (0x9999).fromBCD().shouldEqual(9_999);

Meta