IvanMathy / Boop

A scriptable scratchpad for developers. In slow yet steady progress.
https://boop.okat.best
MIT License
3.77k stars 346 forks source link

Built-in Format Json command loses precision on high Int64 values #372

Open tomhamming opened 1 year ago

tomhamming commented 1 year ago

If you format this example json string using the built-in Format Json command:

{"id": 6150769120280496265}

You get this output:

{
  "id": 6150769120280496000
}

This might be because the Number type in Javascript is a floating-point number and reserves some of its bits for decimal points. To store a full Int64 value, you need BigInt.