I have array of objects. objects have "Poured, Sold, Loss and Variance" properties as string. I want to convert string to float. I need to persist that comma separator and double point precision. Here is the example array of objects.
[{"ID":"September-2016", "Product":"September-2016", "Poured":"111,759.07", "Sold":"107,660.97", "Loss":"-4,098.10", "Variance":"-3.67", "startDate":"2016-09-01", "endDate":"2016-09-22"}, {"ID":"November-2015", "Product":"November-2015", "Poured":"53,690.25", "Sold":"52,953.60", "Loss":"-736.65", "Variance":"-1.37", "startDate":"2015-11-20", "endDate":"2015-11-30"}, {"ID":"May-2016", "Product":"May-2016", "Poured":"156,401.65", "Sold":"151,192.51", "Loss":"-5,209.14", "Variance":"-3.33", "startDate":"2016-05-03", "endDate":"2016-05-31"}, {"ID":"March-2016", "Product":"March-2016", "Poured":"49,260.22", "Sold":"49,399.14", "Loss":"138.92", "Variance":"0.28", "startDate":"2016-03-01", "endDate":"2016-03-09"}, {"ID":"June-2016", "Product":"June-2016", "Poured":"162,126.88", "Sold":"161,718.62", "Loss":"-408.26", "Variance":"-0.25", "startDate":"2016-06-01", "endDate":"2016-06-30"}, {"ID":"July-2016", "Product":"July-2016", "Poured":"160,185.68", "Sold":"154,882.40", "Loss":"-5,303.28", "Variance":"-3.31", "startDate":"2016-07-01", "endDate":"2016-07-31"}, {"ID":"January-2016", "Product":"January-2016", "Poured":"355,509.26", "Sold":"179,696.72", "Loss":"-175,812.54", "Variance":"-49.45", "startDate":"2016-01-01", "endDate":"2016-01-31"}, {"ID":"February-2016", "Product":"February-2016", "Poured":"150,980.73", "Sold":"146,248.72", "Loss":"-4,732.01", "Variance":"-3.13", "startDate":"2016-02-01", "endDate":"2016-02-29"}, {"ID":"December-2015", "Product":"December-2015", "Poured":"167,843.42", "Sold":"163,732.95", "Loss":"-4,110.47", "Variance":"-2.45", "startDate":"2015-12-01", "endDate":"2015-12-31"}, {"ID":"August-2016", "Product":"August-2016", "Poured":"168,853.51", "Sold":"160,024.84", "Loss":"-8,828.67", "Variance":"-5.23", "startDate":"2016-08-01", "endDate":"2016-08-31"}]
I need like
[{"ID":"September-2016", "Product":"September-2016", "Poured":111,759.07, "Sold":107,660.97, "Loss":-4,098.10, "Variance":-3.67, "startDate":"2016-09-01", "endDate":"2016-09-22"}, {"ID":"November-2015", "Product":"November-2015", "Poured":53,690.25, "Sold":52,953.60, "Loss":-736.65, "Variance":-1.37, "startDate":"2015-11-20", "endDate":"2015-11-30"}, {"ID":"May-2016", "Product":"May-2016", "Poured":156,401.65, "Sold":151,192.51, "Loss":-5,209.14, "Variance":-3.33, "startDate":"2016-05-03", "endDate":"2016-05-31"}, {"ID":"March-2016", "Product":"March-2016", "Poured":49,260.22, "Sold":49,399.14, "Loss":138.92, "Variance":0.28, "startDate":"2016-03-01", "endDate":"2016-03-09"}, {"ID":"June-2016", "Product":"June-2016", "Poured":162,126.88, "Sold":161,718.62, "Loss":-408.26, "Variance":-0.25, "startDate":"2016-06-01", "endDate":"2016-06-30"}, {"ID":"July-2016", "Product":"July-2016", "Poured":160,185.68, "Sold":154,882.40, "Loss":-5,303.28, "Variance":-3.31, "startDate":"2016-07-01", "endDate":"2016-07-31"}, {"ID":"January-2016", "Product":"January-2016", "Poured":355,509.26, "Sold":179,696.72, "Loss":-175,812.54, "Variance":-49.45, "startDate":"2016-01-01", "endDate":"2016-01-31"}, {"ID":"February-2016", "Product":"February-2016", "Poured":150,980.73, "Sold":146,248.72, "Loss":-4,732.01, "Variance":-3.13, "startDate":"2016-02-01", "endDate":"2016-02-29"}, {"ID":"December-2015", "Product":"December-2015", "Poured":167,843.42, "Sold":163,732.95, "Loss":-4,110.47, "Variance":-2.45, "startDate":2015-12-01, "endDate":"2015-12-31"}, {"ID":"August-2016", "Product":"August-2016", "Poured":168,853.51, "Sold":160,024.84, "Loss":-8,828.67, "Variance":-5.23, "startDate":"2016-08-01", "endDate":"2016-08-31"}]
Please let me know how can I achieve that.
Sorry I mentioned it as "String to Integer" initially that should be "String to Float"
Number.