Releases: mofosyne/QuickMathJS
Releases · mofosyne/QuickMathJS
v2.1.20
This releases has a few extra bugfixes
- disable spellcheck in html input
- add back in predefined currency notation
- fix/improve custom unit handling
- adjust : to only check the left hand side as it's always going to just be for output
- But bit concerned what if this would cause problem later on to functions with '{param: value}' inside it like format()
- html script only puts up alert if user did not calculation but only typed an expression without result
and other minor changes
v2.1.18
bugfix to fix unary minus handling
Updated syntax to support
- Currency Conversions : QuickMathJS allows for intuitive currency conversions using custom pair ratios. This can also be extended to other types of custom ratios.
- Unit Conversion and Mathematical Expressions : Leverage the power of Math.js to convert between units seamlessly and evaluate complex expressions.
- Custom Functions : Users can define custom functions and evaluate them with specific arguments. This allows for a reusable approach to complex calculations.
- Phrases as Variables : Beyond traditional variable names, QuickMathJS supports using sentences as variable names. Just ensure they don't conflict with reserved keywords in Math.js.
- Custom Units and Compound Calculations : Define your own custom units and perform arithmetic operations with them, even allowing for compound calculations.
# Custom Pair Ratios (e.g. Currency Conversion and Arithmetic with Defined Exchange Rate)
EUR/USD = 1.2
a = 2 USD
b = 2.4 EUR
c = a + 2 * b = 6 USD
a + b in EUR : 4.8 EUR
total = a + c
total in EUR: 9.6 EUR
# Unit Conversion with Math.js
length = 5.08 cm + 2 inch = 10.16 cm
length in cm to inch = 4 inch
# Evaluating Mathematical Expressions
1.2 / (3.3 + 1.7) = 0.24
sin(90 deg) = 1
# Defining and Evaluating Custom Functions
f(x, y) = x ^ y
f(2, 3) = 8
# Phrase As Variabes
Per Person Delivery = 11
People Count = 23
Delivery = 12
Total Food Price = Per Person Delivery * People Count = 253
Total Price = Total Food Price + Delivery = 265
Total Price: 265
# Custom Units
pitbull dogs = 234 fancy animals
flowery cats = 423 fancy animals
animal count = pitbull dogs + flowery cats
animal count: 657 fancy animals
animal count = pitbull dogs * flowery cats
animal count: 98982 fancyanimals^2
v2.1.17
Updated syntax to support
- Currency Conversions : QuickMathJS allows for intuitive currency conversions using custom pair ratios. This can also be extended to other types of custom ratios.
- Unit Conversion and Mathematical Expressions : Leverage the power of Math.js to convert between units seamlessly and evaluate complex expressions.
- Custom Functions : Users can define custom functions and evaluate them with specific arguments. This allows for a reusable approach to complex calculations.
- Phrases as Variables : Beyond traditional variable names, QuickMathJS supports using sentences as variable names. Just ensure they don't conflict with reserved keywords in Math.js.
- Custom Units and Compound Calculations : Define your own custom units and perform arithmetic operations with them, even allowing for compound calculations.
# Custom Pair Ratios (e.g. Currency Conversion and Arithmetic with Defined Exchange Rate)
EUR/USD = 1.2
a = 2 USD
b = 2.4 EUR
c = a + 2 * b = 6 USD
a + b in EUR : 4.8 EUR
total = a + c
total in EUR: 9.6 EUR
# Unit Conversion with Math.js
length = 5.08 cm + 2 inch = 10.16 cm
length in cm to inch = 4 inch
# Evaluating Mathematical Expressions
1.2 / (3.3 + 1.7) = 0.24
sin(90 deg) = 1
# Defining and Evaluating Custom Functions
f(x, y) = x ^ y
f(2, 3) = 8
# Phrase As Variabes
Per Person Delivery = 11
People Count = 23
Delivery = 12
Total Food Price = Per Person Delivery * People Count = 253
Total Price = Total Food Price + Delivery = 265
Total Price: 265
# Custom Units
pitbull dogs = 234 fancy animals
flowery cats = 423 fancy animals
animal count = pitbull dogs + flowery cats
animal count: 657 fancy animals
animal count = pitbull dogs * flowery cats
animal count: 98982 fancyanimals^2
V2.0.9
In this release we transitioned away from :=
into a more heuristics based =
parsing.
This way the calc script looks more like this
a = 5
b = 7
c = a + b = 12
= 12
1 + 1
= 2
c = 12
which is in my opinion more intuitive to understand and better reflect how maths may be written in email or paper.
Also made this more modular and published to npm so you can integrate this to other projects.