One a the biggest weaknees of Bubble is ‘intermediate’ mathematical calculations : that is not included in the core Bubble (min, max, parenthesis priorities, etc). Hopefully, MathJS plugin brings many functions to overcome this. YET, this pluggin really need a bug fix.
When returning a large number like 750 000, the pluggin return a string ‘7.5e+5’… what is completly useless ! Cause Bubble will convert it as 7.5 as a number ! And using the function format( number, { notation : ‘fixed’ }) doesn’t help either cause it return ‘“750000”’ (with quotes… what Bubble can’t convert to number).
Solving this will add a huge value to Bubble. This error brings many bugs that are difficult to identify when doing calculation. And Bubble needs to be able to do Math !
Hi There, I’m totally new to bubble and I haven’t tested this but I’m trying to learn mathjs for my own site and I think the formating is a math.js config and not specific to bubble.
Can you try something like this in your field - format(2.3, {notation: 'fixed', precision: 4})
Thank you Gautam for your suggestion.
The function format() with the option notation: ‘fixed’ is precisely what i used and the option “precision” wouldn’t solve anything. The problem is that the function format() within the plugin returns the result as a number between double quotes, what can’t be converted into numbers by Bubble. The only solution i have found so far is to use the function “:find and replace” (find " and replace by nothing) then “:convert to number”.
It works but the this complex and not optimized.