scaler/options.rs
1// Copyright (c) 2024 구FS, all rights reserved. Subject to the MIT licence in `licence.md`.
2
3
4#[derive(Clone, Debug, Eq, PartialEq)]
5pub enum Rounding
6{
7 Magnitude(i16), // round statically to digit at 10^n, contains precision n
8 SignificantDigits(u8), // round dynamically to n significant numbers, contains precision n
9}
10
11
12#[derive(Clone, Debug, Eq, PartialEq)]
13pub enum Scaling
14{
15 Binary(bool), // scaling by 2^10 = 1.024 until no more prefixes, then fallback to scientific notation, contains whether or not to put space between number and unit prefix
16 Decimal(bool), // scaling by 10^3 = 1.000 until no more prefixes, then fallback to scientific notation, contains whether or not to put space between number and unit prefix
17 None, // no scaling, no fallback to scientific notation
18 Scientific, // always scientific notation
19}
20
21
22#[derive(Clone, Debug, Eq, PartialEq)]
23pub enum Sign
24{
25 Always, // always show sign
26 OnlyMinus, // only show sign when negative
27}