Precision fix for $string function#762
Conversation
Signed-off-by: Ivan Majeru <ivanmajeru@gmail.com>
|
If you add just one more digit to the formatBase test, it fails. I think a true fix to this issue would involve incorporating something like BigDecimal. That being said, I think the issue this PR seeks to solve is better solved by simply using a string for large user IDs instead of integers.
|
|
Yes, it will fail, but not because of the JSONata library. JavaScript works that way. :) You can see the example: const a = 58908407122430764;
console.log(a); // output 58908407122430770
console.log(a.toString()) // the same 58908407122430770
const b = '58908407122430764';
const c = parseInt(b);
console.log(c); // output 58908407122430770The fix is not related to the I completely agree that it’s better to have a string representation for the ID, but we can’t control the third-party API that returns the ID in number format. |
|
Thank you! |

Related to #761