Skip to main content

bcd_to_decimal

Function bcd_to_decimal 

Source
pub fn bcd_to_decimal(raw: u64, nibbles: u8) -> Option<u64>
Expand description

Decode the low nibbles BCD digits of raw to a decimal value.

Each nibble (most-significant first) contributes one decimal digit. Returns None if any of those nibbles is greater than 9, or if nibbles exceeds MAX_NIBBLES.