When adding up all charges for one of our bills, I’m still off by a penny. I suspect this to be a floating point error, but I’m not sure where this is happening…
When using the query below, I’m getting the same total for “storage” as seen in the UI; however, when I manually calculate the sum by adding each individual storage charge for a bill, I’m off by a penny. I checked the math several times.
So I’m seeing the same storage sum in the UI and when querying the API, but when adding up the individual charges in the UI, for a single bill, I’m off by a penny.
Which number do I trust?
Query:
query bill {
bills {
request_id
complexity
data (first: 120 + [NEXT_PAGE]) {
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges {
node {
id
legacy_id
totals (first: 15) {
pageInfo {
hasNextPage
endCursor
}
edges {
node {
id
legacy_id
amount
label
category
quantity
}
}
}
}
cursor
}
}
}
}