Custom field that can evaluate mathematical expressions

  • 4
  • Idea
  • Updated 3 years ago
  • (Edited)
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  for installation instructions, 
updated instructions, new versions of this and other snippets! :D
Photo of mB Remi Gelinas

mB Remi Gelinas

  • 374 Points 250 badge 2x thumb
  • excited

Posted 3 years ago

  • 4
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 18,156 Points 10k badge 2x thumb
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,992 Points 5k badge 2x thumb

Very neat. Thanks for sharing!!!