Skip to content
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

Add "calc" function for eval expressions #997

Closed
squigglezworth opened this issue May 22, 2017 · 3 comments

Comments

@squigglezworth
Copy link

commented May 22, 2017

This was already shortly discussed on IRC, but it would probably be best to have it here.

A ${calc:<some expression>} function that would take parse simple math formulas would be very handy

${calc:1+1} == 2
${calc:(2+2)*2} == 8

@Zarthus

This comment has been minimized.

Copy link
Contributor

commented May 25, 2017

Can you include some functions you feel this would be useful for? It seems weird to have weechat do the maths rather than precompile it. I imagine you're looking to do something like ${calc:60-${current_idle_time}} > 0 of sorts rather than just plain maths?

@squigglezworth

This comment has been minimized.

Copy link
Author

commented May 25, 2017

@flashcode flashcode self-assigned this Sep 20, 2019
@flashcode flashcode added this to the 2.7 milestone Sep 20, 2019
flashcode added a commit that referenced this issue Sep 20, 2019
@flashcode flashcode removed the in progress label Sep 20, 2019
@flashcode

This comment has been minimized.

Copy link
Member

commented Sep 20, 2019

Done, for more information and supported operators, see the documentation here: https://weechat.org/files/doc/devel/weechat_plugin_api.en.html#_string_eval_expression

@flashcode flashcode closed this Sep 20, 2019
flashcode added a commit that referenced this issue Sep 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.