vendredi 24 février 2017

How to make operation from JSON Data

I have json data like this

[{
    "timeinserted": "2017-02-10",
    "upsa_r": "10",
    "upsa_s": "20",
    "upsa_t": "30",
}, {
    "timeinserted": "2017-02-10",
    "upsa_r": "20",
    "upsa_s": "20",
    "upsa_t": "20",
}, {
    "timeinserted": "2017-02-11",
    "upsa_r": "15",
    "upsa_s": "20",
    "upsa_t": "25",
}, {
    "timeinserted": "2017-02-11",
    "upsa_r": "25",
    "upsa_s": "30",
    "upsa_t": "35",
}]

how i make operation (mean) all that data based timeinserted to data like this in javascript->

[{
    "timeinserted": "2017-02-10",
    "upsa_r": "15",
    "upsa_s": "20",
    "upsa_t": "25",
}, {
    "timeinserted": "2017-02-11",
    "upsa_r": "20",
    "upsa_s": "25",
    "upsa_t": "30",
}]

Thank you for your help ^_^




Aucun commentaire:

Enregistrer un commentaire