-
Notifications
You must be signed in to change notification settings - Fork 111
Fraction multiplied by constant #81
Comments
Hey Lucas, The change is made in my commit 450dba3. The code works by checking if it is the last coefficient, if it is, it will run the block of code, that inserted the variables after the coef before, however it will run this in between numerator and denominator. Not sure how @nicolewhite feels about this? A quick solution for you @lucasgruwez might be to disable implicit multiplication in the toString function? |
Hi @Benjadahl, I have looked at how ASCII math would render 2/5x, and it renders it in a way that is hard to misinterpret, that looks like this:
And it renders 2x/5 as something more like:
I think that we can easily agree that the first render is more elegant, therefore, I think it should be an option, rather than a feature. I will have a look at your code and check how it performs. Thank you for making that fix. Lucas |
I think this does make sense but it is a large breaking change, so would need to be released under a new major version, unfortunately. I will think about it more. |
Thanks for the response, as I said before, you could add this as an option, so that existing code doesn't change the output // Example of how this could be done
expr.toString(true) // 2x/5
expr.toString() // 2/5x Therefore, you might not need a major release, but a minor release could do. Lucas |
Hi @nicolewhite,
I noticed that when using algebra.js, a fraction multiplied by a constant is displayed like so:
That could be misinterpreted as
2/(5x)
. I think it would be more logical to display it as2x/5
, which is clearer.Thank you for creating such a great library by the way!
Lucas
The text was updated successfully, but these errors were encountered: