Hello,
I’m using a function in App Script that scraps quotes from Funds360 and puts it into a Google Sheet.
But the type of quote I get is a string. I need this to be a number so I can make an operation on it because the quote does not take into account the subscription fee of the security.
I tried to do this on Google Sheet directly but can’t manage (I tried VALUE, REGEXREPLACE and TO_PURE_NUMBER in vain).
I wanted to know if there is any possibility to make that operation (which is a simple multiplication) directly in PP in the quote path since PP seems to read the string as a number this time.
I’m unable to modify the function since I did not create it myself but here it is in case (thanks to zeroz and jakwarrior from hardware.fr) :
function immorente() {
var nom_fonds = "immorente";
var baseurl = "https://funds360.fefundinfo.com";
var period = "all";
var post_url = baseurl + "/opcvm/graphiques/" + nom_fonds + "/quote/period/" + period + "/isSimple/1";
var headers = {"X-Requested-With": "XMLHttpRequest"};
var options = {"method": "post", "headers": headers, "followRedirects": false, "muteHttpExceptions": true};
var response = UrlFetchApp.fetch(post_url, options);
var html = response.getContentText();
var searchstring_start = "\"dataProvider\":";
var debut = html.search(searchstring_start);
var searchstring_end = ",\"fieldMappings\"";
var fin = html.search(searchstring_end);
var liste = "";
if (debut >= 0) {
var pos = debut + searchstring_start.length + 1;
liste = html.substring(pos, fin);
}
liste = '[' + liste
var dataAll = JSON.parse(liste);
return dataAll;
}
Thanks for you help