make_num

Function make_num 

Source
pub(crate) fn make_num(
    digits: &str,
    hasdot: bool,
    state: NumeralMode,
) -> Result<Unsigned36Bit, StringConversionFailed>
Expand description

Convert a string to an Unsigned36Bit.

§Combining state and hasdot

statehasdotConversion Base
NumeralMode::OctalfalseOctal
NumeralMode::DecimalfalseDecimal
NumeralMode::OctaltrueDecimal
NumeralMode::DecimaltrueOctal

§Arguments

  • digits - the octal or decimal digits
  • hasdot - if true, the input has a trailing dot (not in digits).
  • state - indicates whether the default mode is octal or decimal.

TODO: consider just having the caller call make_u36() directly.