Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
utils/analytics: improve accuracy of GitHub Packages download counts
`millions_match.captures.first` will typically be a decimal (since it's matched using `\d+\.\d+`), except we lose accuracy in the `#to_i` conversion. Before: ``` ❯ brew info --analytics --github-packages-downloads sqlite ==> Analytics ==> install (30 days) [snip] ==> GitHub Packages Downloads 1,009,898 (30 days) ``` After: ``` ❯ brew info --analytics --github-packages-downloads sqlite ==> Analytics ==> install (30 days) [snip] ==> GitHub Packages Downloads 1,199,898 (30 days) ``` In this case `1.19M` was being rounded down to `1M`.
- Loading branch information