1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00

Fix Incorrect output with Other option

This commit is contained in:
davigonz 2018-05-16 17:47:12 +02:00
parent f3566d667e
commit fdbe23923e

View File

@ -40,6 +40,7 @@ import org.apache.jackrabbit.webdav.MultiStatus;
import org.apache.jackrabbit.webdav.client.methods.PropFindMethod;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
/**
@ -173,18 +174,18 @@ public class GetRemoteUserQuotaOperation extends RemoteOperation {
} else {
BigDecimal totalQuota = we.quotaAvailableBytes().add(we.quotaUsedBytes());
BigDecimal totalQuota = we.quotaAvailableBytes().add(we.quotaUsedBytes());
BigDecimal relativeQuota = we.quotaUsedBytes()
.multiply(new BigDecimal(100))
.divide(totalQuota);
BigDecimal relativeQuota = we.quotaUsedBytes()
.multiply(new BigDecimal(100))
.divide(totalQuota, 2, RoundingMode.HALF_UP);
return new Quota(
we.quotaAvailableBytes().longValue(),
we.quotaUsedBytes().longValue(),
totalQuota.longValue(),
relativeQuota.doubleValue()
);
return new Quota(
we.quotaAvailableBytes().longValue(),
we.quotaUsedBytes().longValue(),
totalQuota.longValue(),
relativeQuota.doubleValue()
);
}
}
}