From 2a38669e8778af47779a962a168b1999f6995ecb Mon Sep 17 00:00:00 2001 From: Simon Treanor Date: Wed, 21 Feb 2024 11:11:16 +0000 Subject: [PATCH] readability tweak --- src/Currency.fs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Currency.fs b/src/Currency.fs index f511ead..aff5ebc 100644 --- a/src/Currency.fs +++ b/src/Currency.fs @@ -15,8 +15,10 @@ module Currency = module Cent = /// max of two cent values let max (c1: int64) (c2: int64) = max (int64 c1) (int64 c2) * 1L + /// min of two cent values let min (c1: int64) (c2: int64) = min (int64 c1) (int64 c2) * 1L + /// derive a rounded cent value from a decimal according to the specified rounding method let round rounding (m: decimal) = match rounding with @@ -25,7 +27,9 @@ module Currency = | Round mpr -> Math.Round(m, 0, mpr) |> int64 |> (( * ) 1L) + /// lower to the base currency unit let fromDecimal (m: decimal) = round (Round MidpointRounding.AwayFromZero) (m * 100m) + /// raise to the standard currency unit let toDecimal (c: int64) = decimal c / 100m