pub struct InRadix<'a> { /* private fields */ }
Expand description

Representation of a UBig or IBig in any radix between 2 and 36 inclusive.

This can be used to format a number in a non-standard radix.

The default format uses lower-case letters a-z for digits 10-35. The “alternative” format ({:#}) uses upper-case letters.

Examples

assert_eq!(format!("{}", ubig!(83).in_radix(3)), "10002");
assert_eq!(format!("{:+010}", ubig!(35).in_radix(36)), "+00000000z");
// For bases 2, 8, 10, 16 we don't have to use `InRadix`:
assert_eq!(format!("{:x}", ubig!(3000)), "bb8");
assert_eq!(format!("{:x}", ibig!(-3000)), "-bb8");

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.