Skip to content

Commit

Permalink
feat: Format large numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
stchris committed Jan 29, 2024
1 parent dc1aa8b commit a00db67
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
17 changes: 17 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ chrono-humanize = "0.2"
color-eyre = "0.6"
crossterm = "0.27"
home = "0.5"
num-format = "0.4"
ratatui = "0.25"
reqwest = { version = "0.11", features = ["blocking", "json"]}
serde = { version = "1.0", features=["derive"]}
Expand Down
7 changes: 4 additions & 3 deletions src/ui.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use chrono::{NaiveDateTime, Utc};
use chrono_humanize::{Accuracy, HumanTime, Tense};
use num_format::{Locale, ToFormattedString};
use ratatui::{
layout::{Alignment, Constraint, Direction, Layout, Rect},
prelude::Frame,
Expand Down Expand Up @@ -92,9 +93,9 @@ pub fn render(app: &mut App, f: &mut Frame) {
rows.push(Row::new(vec![
result.collection.id.to_string(),
result.collection.label.to_string(),
result.finished.to_string(),
result.running.to_string(),
result.pending.to_string(),
result.finished.to_formatted_string(&Locale::en),
result.running.to_formatted_string(&Locale::en),
result.pending.to_formatted_string(&Locale::en),
last_update,
]))
}
Expand Down

0 comments on commit a00db67

Please sign in to comment.