Skip to content

Commit

Permalink
Merge pull request #6 from stchris/feature/number-format
Browse files Browse the repository at this point in the history
feat: Format large numbers
  • Loading branch information
stchris committed Feb 7, 2024
2 parents 95d72e7 + 1c62203 commit 6dde1a8
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 7 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.

21 changes: 17 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ chrono-humanize = "0.2"
color-eyre = "0.6"
crossterm = "0.27"
home = "0.5"
num-format = "0.4"
ratatui = "0.26"
reqwest = { version = "0.11", features = ["blocking", "json"]}
serde = { version = "1.0", features=["derive"]}
reqwest = { version = "0.11", features = ["blocking", "json"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
toml = "0.8"

Expand All @@ -34,7 +35,12 @@ ci = ["github"]
# The installers to generate for each app
installers = ["shell", "homebrew"]
# Target platforms to build apps for (Rust target-triple syntax)
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"]
targets = [
"aarch64-apple-darwin",
"x86_64-apple-darwin",
"x86_64-unknown-linux-gnu",
"x86_64-pc-windows-msvc",
]
# Publish jobs to run in CI
pr-run-mode = "plan"
# A GitHub repo to push Homebrew formulas to
Expand All @@ -46,4 +52,11 @@ publish-jobs = ["homebrew"]
publish = false
push = true
tag = true
pre-release-hook = ["git", "cliff", "-o", "CHANGELOG.md", "--tag", "{{version}}" ]
pre-release-hook = [
"git",
"cliff",
"-o",
"CHANGELOG.md",
"--tag",
"{{version}}",
]
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 6dde1a8

Please sign in to comment.