Struct dochy_compaction::kval_enum::Decimal[][src]

pub struct Decimal {
    pub int: i128,
    pub dot: u8,
}
Expand description

Decimal represents 40 digits with dot. It’s supposed to be used for decimal strings which can be converted to without errors.

Fields

int: i128

The integer part.

dot: u8

The number is an integer when dot == 0. When dot == 1, the dot slides to left. If int == 128, it’s 12.8. If int == 100, it’s 10.0 When dot == 2, if int == 128, it’s 1.28. If int == 100, it’s 1.00 …

Implementations

get the nearest f64

get the edecimal string

create the value

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. 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.