-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Special syntax for increase_by/decrease_by percentage-calculation functions #617
Comments
Maybe I'm being unnecessarily picky but I think it is not ideal that the proposed operator dictates the unit of the second operand, in my opinion the new "increase-by" and "decrease-by" operators should work for any scalar second operand. So |
I think the operator notation is fine but I agree it should work the way you describe here. |
Would syntax for percent_change maybe be useful too? I’m thinking something like
I’m not quite sure if the greater than less than characters are ideal, but I think the concept might be useful. |
Oh yes, definitely.
Yes. The only question is, would Somewhat related: I think it would be nice if Numbat had a set of binary (any maybe unary) operators that the user would have available for their own use. Similar to how this works in Haskell-style languages: fn append(lhs, rhs) = …
infixr 5 append as <> |
Now that the
increase_by
/decrease_by
percentage-calculation functions have been added, it would be great to have an easy and quick syntax to do those kinds of calculations. The following syntax was proposed in the discussion of #494:1000 -% 20
1000 +% 20
Seeing as syntax like
72 € - 15%
can't be supported, the proposed syntax (above) is the next best thing, and has the advantage of being quick to type and easier to remember.So, instead of
72 € - 15%
, we would use:72 € -% 15
The text was updated successfully, but these errors were encountered: