DarkMatter.Decimals.Arithmetic (DarkMatter v1.1.4) View Source

Decimal arithmetic functions

Link to this section Summary

Link to this section Functions

Specs

Add Decimal

Link to this function

decimal_avg(decimals, default \\ 0)

View Source

Specs

Avg Decimal

Link to this function

decimal_div(dividend, divisor, default \\ 0)

View Source

Specs

Div Decimal

Link to this function

decimal_mult(left, right)

View Source

Specs

Multiply Decimal

Link to this function

decimal_percentage(allocation, total)

View Source

Specs

decimal_percentage(DarkMatter.numeric(), DarkMatter.numeric()) :: Decimal.t()

Calculate the percentage.

Specs

Sub Decimal

Link to this function

decimal_sum(decimals, default \\ 0)

View Source

Specs

Sum Decimal

Specs

from_percentage(DarkMatter.numeric()) :: Decimal.t()

Cast from a percentage.

Specs

to_percentage(DarkMatter.numeric()) :: Decimal.t()

Cast to a percentage.