如何格式化获取的.gs返回? 输出为f。 e。 9700.01234567 我的输出应该是9700,01
function getCoinbasePrice(quote, base) {
// write code
// get currency pair
var currencyPair = quote + "-" + base;
// get CoinbaseAPI endpoint
var url = "https://api.coinbase.com/v2/prices/" + currencyPair + "/spot" ;
var response = UrlFetchApp.fetch(url);
var jsonResponse = JSON.parse(response);
// Get latest price
return jsonResponse.data.amount;
}