๐Ÿ“ฆ sleepyfran / duets

๐Ÿ“„ Amount.fs ยท 11 lines
1
2
3
4
5
6
7
8
9
10
11module Duets.Entities.Amount

/// Creates an amount from a decimal value.
let fromDecimal (amount: decimal) : Amount = amount * 1m<dd>

/// Creates an amount from a float value.
let fromFloat (amount: float) : Amount = amount |> decimal |> fromDecimal

/// Concerts an amount to a decimal value.
let toDecimal (amount: Amount) : decimal = amount / 1m<dd>