0

I find math.js Don't have solve function for an unknown equation like the following equation
var eq = (2.75501+x*0.0013016)+(1.89908+x*-0.0006573)-5 = 0

and when I try to simplify

var simplify_eq =math.rationalize("(2.75501+x*0.0013016)+(1.89908+x*-0.0006573)-5");

it gives me: 6.443e-4 * x - 0.34590999999999994
which e I don't want
I want the number to be 0.00006443
I have tried library like algebra.js but it cannot solve with e like above

j08691
  • 204,283
  • 31
  • 260
  • 272
  • 2
    `6.443e-4` **is** `0.00006443`. It's two ways of writing exactly the same value. – Pointy Oct 07 '19 at 13:56
  • 4
    Possible duplicate of [How to avoid scientific notation for large numbers in JavaScript?](https://stackoverflow.com/questions/1685680/how-to-avoid-scientific-notation-for-large-numbers-in-javascript) – Mike Doe Oct 07 '19 at 13:56
  • For the second part of your question, you could multiply it by 10m round it then divide by 10m... `answer = Math.round(answer * 10000000) / 10000000` – Paul Oct 07 '19 at 14:01

0 Answers0