Plugin: Math Eval v2.0

Browse, download and discuss plugins for Blumentals code editors

Plugin: Math Eval v2.0

Postby pmk65 » Fri Jul 03, 2015 3:52 pm

Allows you to evaluate mathematical expression in selection or on current line. Result will then be inserted in the editor.
Plugin can be activated either by menu or by pressing the HotKey Ctrl+'

You can use all JavaScript Math Object Methods in your mathematical expression with or without preceding it with "Math."
abs(x), acos(x), asin(x), atan(x), atan2(y,x), ceil(x), cos(x), exp(x), floor(x), log(x), max(x,y,z,...,n), min(x,y,z,...,n), pow(x,y), random(), round(x), sin(x), sqrt(x) and tan(x)

Example: pow(6,8) or Math.pow(6,8)

The following Math Constants are also valid: E, LN2, LN10, LOG2E, LOG10E, PI, SQRT1_2, SQRT2

How it works:
    If you make a SELECTION and activate the plugin, the SELECTION will be evaluated and the REPLACED by the mathematical result.
    If the line ENDS with a "=" sign, anything on the LEFT of the "=" will be evaluated and the result will be INSERTED after the "=" sign.
    Otherwise, if the line CONTAINS a "=" sign, anything on the RIGHT of the "=" will be evaluated and the REPLACED by the mathematical result.

Example Screencapture video:


Installation:
1) Download plugin .ZIP file.
2) Open WeBuilder and select "Plugins -> Manage Plugins" from the menu.
3) Click "Install" and select the .ZIP file you downloaded in step 1.

History
v1.0 - Uses Webkit engine to evaluate math expression.
v2.0 - Rewrite. Now uses MSScriptControl to evaluate math expression (MUCH faster than using WebKit). - Improved Undo functionality. - Added support for Math Constants. - Added icon.

Feedback appreciated. ;)
(I only use WeBuilder, so I haven't tested if it works in HTMLPad, Rapid CSS or Rapid PHP.)
Attachments
Math Eval.zip
Math Eval v2.0
(3.48 KiB) Downloaded 14 times
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 360
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Re: Plugin: Math Eval v2.0

Postby pmk65 » Sun Mar 26, 2017 12:26 am

New improved version added.
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 360
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark


Return to Plugins for HTMLPad / Rapid CSS / Rapid PHP / WeBuilder

Who is online

Users browsing this forum: No registered users and 2 guests

cron