Hello everyone, I am facing an issue with converting the 'review' value from String to a numerical format in JSON. This is causing problems when trying to perform calculations, leading to incorrect results.
The scenario involves saving user comments about a product in Firebase as JSON data. However, the 'review' field is stored as a String instead of a number. Is there a way to easily convert this data to a numerical format?
Below is the sample JSON response:
"[{\"review\":\"4\",\"comment\":\"Good product \",\"name\":\"SnowFall\",\"image\":\"https://lh3.googleusercontent.com\",\"method\":\"google\"}]"
Here is a snippet of my TypeScript code:
---Code snippet removed for brevity---
This is how the data is structured in FireBase FireBase RealTime Database
And here is how it appears on the FrontEnd: FrontEnd