Struct tengwar::characters::numeral::Numeral
source · pub struct Numeral {
pub value: isize,
pub base_10: bool,
pub ordinal: bool,
pub lines: bool,
pub little_endian: bool,
}
Expand description
A numeric value, paired with formatting information.
Fields§
§value: isize
Numeric value.
base_10: bool
Whether the number will be displayed in Decimal, base 10, rather than in Duodecimal, base 12.
ordinal: bool
Whether the number is ordinal (“first”), rather than cardinal (“one”).
lines: bool
Whether the base of the number will be denoted with lines, rather than with dots.
little_endian: bool
Whether the less significant digits of will be written first. This is the style preferred by the Eldar, but as the least significant digit is marked, it can go either way without ambiguity.
Implementations§
source§impl Numeral
impl Numeral
sourcepub const PREF_NEG_OUT: char = '-'
pub const PREF_NEG_OUT: char = '-'
Prefix to be prepended to the output form of a negative number.
sourcepub const PREF_POS_OUT: char = '+'
pub const PREF_POS_OUT: char = '+'
Prefix to be prepended to the output form of a positive number.
sourcepub const SUFF_ORD_OUT: char = '\u{e018}'
pub const SUFF_ORD_OUT: char = '\u{e018}'
Suffix to be appended to the output form of an ordinal number.
sourcepub const fn new(value: isize, base_10: bool) -> Self
pub const fn new(value: isize, base_10: bool) -> Self
Define a value in either Base-10 or Base-12.
sourcepub const fn duodecimal(value: isize) -> Self
pub const fn duodecimal(value: isize) -> Self
Define a Base-12 duodecimal, or dozenal, value.