Custom field that can evaluate mathematical expressions

edited October 15, 2019 in Ideas
I was tasked with making a small quality of life change to our org that would make entering expressions or big data easier on our users, and after some tinkering, I came up with a field renderer that does just that.

This snippet leverages the really awesome math.js library to allow you to enter complex expressions into any field it's assigned to, and with a key press (currently Tab or Enter, but it's easily changed), evaluates the current expression if it's valid. The snippet will keep track of what you enter and let you know what is and isn't considered a valid expression.

Because the snippet uses math.js, it can evaluate anything the library can. This includes powerful stuff like complex expressions involving BEDMAS, or matrix math, and extends to obscure but really cool stuff like unit conversion.

The snippet signifies fields it's attached by sticking a small calculator icon on it, which pulls its color from the Skuid theme currently in use.

Installation & Demo







Please visit https://github.com/mBlazonry/mBlazonrySupport  for installation instructions, 
updated instructions, new versions of this and other snippets! :D
4
4 votes

Awaiting Review · Last Updated

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!