Skip to content

Commit

Permalink
Use canonical name CopySign
Browse files Browse the repository at this point in the history
  • Loading branch information
FreeApophis committed Jan 7, 2021
1 parent 6dcd2dd commit 38cc72f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Funcky.Money/Distribution/DefaultDistributionStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private static decimal ExactSlice(MoneyDistribution distribution, int index, Mon
=> money.Amount / DistributionTotal(distribution) * distribution.Factors[index];

private decimal SignedPrecision(MoneyDistribution distribution, Money money)
=> Precision(distribution, money).WithSignFrom(money.Amount);
=> Precision(distribution, money).CopySign(money.Amount);

// Order of evaluation: Distribution > Context Distribution > Context Currency > Money Currency
private decimal Precision(MoneyDistribution distribution, Money money)
Expand Down
2 changes: 1 addition & 1 deletion Funcky.Money/Extensions/SignExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace Funcky.Extensions
{
internal static class SignExtension
{
public static decimal WithSignFrom(this decimal positiveNumber, decimal signSource)
public static decimal CopySign(this decimal positiveNumber, decimal signSource)
=> signSource switch
{
< 0 => -positiveNumber,
Expand Down

0 comments on commit 38cc72f

Please sign in to comment.