pub struct Settings {
pub format: NumberFormat,
pub comma: bool,
pub base: Base,
pub word_size: u32,
pub all_parens: bool,
pub real_point: bool,
pub power_right: bool,
pub group_digits: bool,
pub tag_colon: bool,
}Expand description
The display settings the text depends on.
Fields§
§format: NumberFormatReal number format.
comma: boolComma as the fraction mark (flag -51); the separator in complex
numbers becomes ;.
base: BaseBinary integer base (flags -11, -12).
word_size: u32Binary integer word size in bits, 1-64 (flags -5 to -10).
all_parens: boolShow every parenthesis in algebraics (flag -53).
real_point: boolReals with an integer value keep their point (5.), as on the 49G,
whose exact integers show without one (not inside unit objects).
power_right: bool^ groups to the right (A^B^C is A^(B^C)), as on the 49G; on
the 48 it groups to the left.
group_digits: boolFIX groups the integer digits by three (1,234.500; 1.234,500
with a comma fraction mark) inside lists, programs, arrays and
tagged objects too, as the 49G does; both models group a real that
is a whole stack level. Never inside complex numbers, algebraics or
units.
tag_colon: boolA tagged object inside a composite shows its tag between colons
(:T: 5, the 48) or with a trailing one only (T: 5, the 49G, and
both models for a whole stack level).
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn from_flags(flags: &Flags, model: Model) -> Settings
pub fn from_flags(flags: &Flags, model: Model) -> Settings
The settings flags select on model.
Sourcepub fn for_editing(self) -> Settings
pub fn for_editing(self) -> Settings
These settings for text that is edited and compiled again: every digit of a real (STD), binary integers at 64 bits, no digit grouping and tags between colons, so that the text compiles back to the same object; the fraction mark, base and parentheses stay.
Sourcepub fn binary(&self, value: u64) -> String
pub fn binary(&self, value: u64) -> String
value as a binary integer in the base and word size.
Sourcepub fn unit_number(&self, r: &Real) -> String
pub fn unit_number(&self, r: &Real) -> String
A unit object’s number or power: an integer value as an integer
(2_m^2 even in FIX), anything else in the display mode; never a
trailing point or digit groups (oracle-checked: 1.50E0_m^2.50E0
in 2 SCI).