• danda@lemmy.zip
    link
    fedilink
    arrow-up
    1
    ·
    1 month ago

    It’s because parseInt is expecting a string, so the decimal gets converted to a string, and 0.0000005.toString() returns 5e-7.

    • Victor@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      1 month ago

      Classic people who don’t know how to code wat. Passing a number in place of a string argument because they don’t know what they’re doing.