mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-07-23 06:13:38 -04:00
Fixed rounding errors in GitHub stars
This commit is contained in:
@@ -115,7 +115,7 @@ export function truncate(value: string, n: number): string {
|
||||
export function round(value: number): string {
|
||||
if (value > 999) {
|
||||
const digits = +((value - 950) % 1000 > 99)
|
||||
return `${((value + 1) / 1000).toFixed(digits)}k`
|
||||
return `${((value + 0.000001) / 1000).toFixed(digits)}k`
|
||||
} else {
|
||||
return value.toString()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user