mirror of
https://github.com/redlib-org/redlib.git
synced 2025-05-14 22:12:58 +00:00
Add number format utility
This commit is contained in:
parent
6794f7d6ba
commit
9f19d729d1
3 changed files with 12 additions and 6 deletions
|
@ -89,8 +89,8 @@ async fn subreddit(sub: &String) -> Result<Subreddit, &'static str> {
|
|||
title: val(&res, "title").await,
|
||||
description: val(&res, "public_description").await,
|
||||
icon: format_url(val(&res, "icon_img").await.as_str()).await,
|
||||
members: if members > 1000 { format!("{}k", members / 1000) } else { members.to_string() },
|
||||
active: if active > 1000 { format!("{}k", active / 1000) } else { active.to_string() },
|
||||
members: format_num(members),
|
||||
active: format_num(active),
|
||||
};
|
||||
|
||||
Ok(sub)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue