Do not floor the resultant string value.

This commit is contained in:
Brett Gilio 2022-12-22 21:06:52 +00:00
parent 4cfba05c56
commit 523834c403

View file

@ -8,5 +8,5 @@ export default (count: number) => {
const {divisor, suffix} =
suffixes[Math.min(suffixes.length - 1, Math.floor(Math.log10(count) / 3))];
return (count / divisor).toFixed(2).slice(0, -1) + suffix;
return String(Math.ceil((count / divisor) * 10) / 10).concat(suffix);
};