Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Show extension download counts with thousands separators (#12857)
Marshall Bowers57c40299a589
diff --git a/Cargo.lock b/Cargo.lockindex a7510819df5..6b8b78fbb1c 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -3833,6 +3833,7 @@ dependencies = ["fuzzy","gpui","language",+ "num-format","picker","project","release_channel",@@ -6735,6 +6736,16 @@ dependencies = ["syn 1.0.109",]+[[package]]+name = "num-format"+version = "0.4.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3"+dependencies = [+ "arrayvec",+ "itoa",+]+[[package]]name = "num-integer"version = "0.1.45"diff --git a/Cargo.toml b/Cargo.tomlindex cb58423a818..523056e1f4d 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -307,6 +307,7 @@ log = { version = "0.4.16", features = ["kv_unstable_serde"] }markup5ever_rcdom = "0.3.0"nanoid = "0.4"nix = "0.28"+num-format = "0.4.4"once_cell = "1.19.0"ordered-float = "2.1.1"palette = { version = "0.7.5", default-features = false, features = ["std"] }diff --git a/crates/extensions_ui/Cargo.toml b/crates/extensions_ui/Cargo.tomlindex 91b3d69d6a1..3fd04fca4e3 100644--- a/crates/extensions_ui/Cargo.toml+++ b/crates/extensions_ui/Cargo.toml@@ -24,6 +24,7 @@ fs.workspace = truefuzzy.workspace = truegpui.workspace = truelanguage.workspace = true+num-format.workspace = truepicker.workspace = trueproject.workspace = truerelease_channel.workspace = truediff --git a/crates/extensions_ui/src/extensions_ui.rs b/crates/extensions_ui/src/extensions_ui.rsindex 9ef43f8bd50..785d56d3340 100644--- a/crates/extensions_ui/src/extensions_ui.rs+++ b/crates/extensions_ui/src/extensions_ui.rs@@ -16,6 +16,7 @@ use gpui::{InteractiveElement, KeyContext, ParentElement, Render, Styled, Task, TextStyle,UniformListScrollHandle, View, ViewContext, VisualContext, WeakView, WhiteSpace, WindowContext,};+use num_format::{Locale, ToFormattedString};use release_channel::ReleaseChannel;use settings::Settings;use std::ops::DerefMut;@@ -487,8 +488,11 @@ impl ExtensionsPage {.size(LabelSize::Small),).child(- Label::new(format!("Downloads: {}", extension.download_count))- .size(LabelSize::Small),+ Label::new(format!(+ "Downloads: {}",+ extension.download_count.to_formatted_string(&Locale::en)+ ))+ .size(LabelSize::Small),),).child(