I have a Laravel application that produces 17 digit (64 bit) numeric IDs (laravel-snowflake)
When this collection is rendered into an Inertia Vue component as a prop, the last 2 digits are being rounded to the nearest 10.
37648503920529408 is being rounded to 37648503920529410
37648503945695232 is being rounded to 37648503945695230
This doesn't happen all the time, but it does for most IDs.
I've dumped the collection through each class of the pipeline and it always matches the database, only when it gets into Vue are the IDs rounded.
Any explanations for this?
Number.MAX_SAFE_INTEGERwhich is9007199254740991. Your 17 digit number exceeds that range. The solution is to not cast to a number but a string instead.