The thing is, the data passed to me by our back-end engineer has a Long type data with more than 18 digits.
I told him that the last two digits of this data will become 00 after converting to JS.
I asked him to transmit the String type to me, or shorten the length of the Long, but he was unwilling.
He told me that there are many ways to solve this problem in the front end, such as BigInt or other ways.
What I want to ask is, in the architecture of a project, who should be responsible for this data? Front-end engineer or back-end engineer? What is the best way to deal with it?
Personally, I can't say if there's really a single source responsible. The small differences in languages and their data structures make this question difficult- JSON with web servers being a perfect example.
I think this is a responsibility of both parties to find the best conclusion. I think the most important question to ask would be: "Is it possible for the number have less digits?" and if the answer is no, for precision or whatever reason, it's on the front end engineer. It's on the backend engineer, however, to ensure they know what is absolutely necessary before simply throwing a new problem to solve at the frontend.