1
0
Fork 0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2026-05-26 12:32:25 +00:00

Make VSCode type detection happier

This commit is contained in:
Cadence Ember 2021-05-11 21:27:57 +12:00
parent cd7969973b
commit ec9b0edadc
No known key found for this signature in database
GPG key ID: BC1C2C61CF521B17
7 changed files with 13 additions and 1 deletions

View file

@ -151,7 +151,7 @@ function preroundedCountToText(count) {
for (const scale of [[1e9, "B"], [1e6, "M"], [1e3, "K"]]) {
if (count >= scale[0]) {
// YouTube returns 3 significant figures. At least it does for channels.
const rounded = (count/scale[0]).toPrecision(3)
const rounded = (count/+scale[0]).toPrecision(3)
return `${rounded}${scale[1]}`
}
}