fend
fend copied to clipboard
Overload `of` operator for percentages
See https://github.com/printfn/fend/pull/165#issue-1337725749 by @Techcable:
Proposal to overload of
I propose overloading the
of
operator specifically to handle this case with percentages. We would have5% of 100 == 5
, while multiplication would give500%
. This would clear up any ambiguity (although I would probably file a separate issue/PR).It should not cause issues with any other operations, since it would only activate when a percentage is on the left-side of the of operator (similar to how string concat is special-cased in many languages).