i am in a bit tricky situation. I fetch some price values from a sqlite db and store it in a react state.
the response looks like: [{"price":50},{"price":"49,95"}]
i need to store these values as TEXT insted of INTEGER, because i have a lot of differrent decimal places. also using float in sqlite will not give me exact values, see the problem in this example: https://dba.stackexchange.com/questions/15729/storing-prices-in-sqlite-what-data-type-to-use
So to my main problem: how can i extract and convert the values from the json array to numbers, and sum it up?
50->5000,"49,95"->4995. Use a library for fixed-point arithmetic. Use a library for infinite precision. Do the calculation based on strings.