mui / mui/base-ui

[number field] Can Number Field be used to evaluate equations?

Open
#2,152 9 comments 1 reaction 0 assignees View on GitHub
component: number field support: question
Dominant language
TypeScript
Stars
10.9k
Forks
543
Avg merge
1d 20h
Merged PRs (30d)
101

Description

I'd like to make a `Number Field` that can also evaluate equations using [math.js](https://mathjs.org/index.html).

"5 + 20" -> "25"

"sqrt(16)" -> "4"

Is this possible with the current `Number Field`? I can't seem to find a way to let the input accept special characters. I'd also need to extend the parse function to attempt to evaluate with math.js before the base-ui parse function takes over.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.