dysmal

Types

Decimal type

pub type Decimal

Options type for precision and rounding

pub type Opts {
  Opts(precision: Int, rounding: RoundingAlgorithm)
}

Constructors

pub type RoundingAlgorithm {
  RoundHalfUp
  RoundHalfDown
  RoundHalfEven
  RoundUp
  RoundDown
  RoundCeiling
  RoundFloor
}

Constructors

  • RoundHalfUp
  • RoundHalfDown
  • RoundHalfEven
  • RoundUp
  • RoundDown
  • RoundCeiling
  • RoundFloor

Values

pub fn from_string(value: String) -> Decimal

Create a new Decimal from a string.

pub fn from_string_with_opts(
  value: String,
  opts: Opts,
) -> Decimal

Create a new Decimal from a String with precision and rounding options.

pub fn to_string(decimal: Decimal) -> String

Convert a Decimal to a String.

Search Document