Google 驱动器 api 未显示正确的 gmail 配额使用情况

Google drive api doesn't show correct quota usage for gmail

我正在尝试使用 google 驱动器 api 来获取用于 gmail 的配额。我从 api 得到的响应如下: api 使用:https://developers.google.com/drive/v2/reference/about/get

{
 "quotaBytesTotal": "246960619520",         //246.96061952 GB
 "quotaBytesUsed": "5256850",
 "quotaBytesUsedAggregate": "85358344030",        //85.35834403 GB
 "quotaBytesUsedInTrash": "0",
 "quotaType": "LIMITED",
 "quotaBytesByService": [
{
 "serviceName": "DRIVE",
 "bytesUsed": "0"
},
{
 "serviceName": "GMAIL",
 "bytesUsed": "85353087180"       //85.3531 GB
},
{
 "serviceName": "PHOTOS",
 "bytesUsed": "0"
}

当我登录我的 gmail 帐户时,我看到以下信息:

34% full
Using 79.59 GB of your 230 GB

这似乎不匹配。

这是计算容量时binary/decimal混淆的情况。您通过除以小数 'billion' (10^9) 将 'bytes' 转换为 'gigabytes'。但是像计算机一样思考:你真的想要除以 2^30 (1024*1024*1024)。

246960619520 / 10^9 = 246.9 GB

246960619520 / 2^30 = 230.0 GB

另请参阅:Binary vs. Decimal Measurements