fromBCD

Converts BCD value into decimal format

ushort
fromBCD
(
ushort bcd
)

Parameters

bcd ushort

ushort in BCD format

Return Value

Type: ushort

decimal value

Examples

assert(0.fromBCD() == 0);
assert((0x22).fromBCD() == 22);
assert((34).fromBCD() == 22);
// 17bcd
assert((0b0001_0111).fromBCD() == 17);
assert(295.fromBCD() == 127);
assert(39_321.fromBCD() == 9_999);
assert((0x9999).fromBCD() == 9_999);

Meta