Decimal.this

Constructs an exact decimal type from a built in number

  1. this(T num)
    struct Decimal(Hook = Abort)
    pure
    this
    (
    T
    )
    (
    T num
    )
    if (
    isNumeric!T
    )
  2. this(S str)
  3. this(S str)

Parameters

num T

the number to convert to exact decimal

Note: Using float types for construction is less accurate than using a string representation due to floating point inaccuracy. If possible, it's always better to use string construction.

Meta