From 21763c51cd742102c01dbca0e12ebd512099110e Mon Sep 17 00:00:00 2001 From: spikecodes <19519553+spikecodes@users.noreply.github.com> Date: Sun, 17 Jan 2021 12:59:40 -0800 Subject: [PATCH] Make number formatting inclusive --- src/utils.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils.rs b/src/utils.rs index 4804ca6..371f18d 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -176,9 +176,9 @@ pub fn rewrite_url(text: &str) -> String { // Append `m` and `k` for millions and thousands respectively pub fn format_num(num: i64) -> String { - if num > 1_000_000 { + if num >= 1_000_000 { format!("{}m", num / 1_000_000) - } else if num > 1000 { + } else if num >= 1000 { format!("{}k", num / 1_000) } else { num.to_string()