Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: number formatted printing #591

Merged
merged 3 commits into from
Jul 21, 2020

Conversation

NickHackman
Copy link
Contributor

@NickHackman NickHackman commented Jul 17, 2020

Closes #256 and #458

With the major release migrating #458 completely seemed like more work than starting from scratch as a result of the redesign of the printing system.

Adds command line argument to print numbers with commas, plain, or dots.
For example, dots would result in 1.324.

Benchmark

Tokei Benchmarking Tool
The use of this tool requires tokei, and hyperfine to be installed and available in your PATH variable.
Please enter the path you would like to benchmark:
hyperfine 1.10.0old tokei: tokei 12.0.4 compiled with serialization support: json
    Finished release [optimized] target(s) in 0.07s
Benchmark #1: target/release/tokei ../rust
  Time (mean ± σ):     115.3 ms ±   2.4 ms    [User: 646.5 ms, System: 192.7 ms]
  Range (min … max):   111.6 ms … 121.1 ms    25 runs
 
Benchmark #2: tokei ../rust
  Time (mean ± σ):     116.3 ms ±   2.8 ms    [User: 657.2 ms, System: 190.3 ms]
  Range (min … max):   112.1 ms … 121.2 ms    25 runs
 
Summary  'target/release/tokei ../rust' ran    1.01 ± 0.03 times faster than 'tokei ../rust'

Adds commandline argument to print numbers with commas, plain, or dots.
For example, dots would result in 1.324.
src/cli_utils.rs Outdated Show resolved Hide resolved
src/cli_utils.rs Show resolved Hide resolved
src/cli_utils.rs Show resolved Hide resolved
src/cli_utils.rs Outdated Show resolved Hide resolved
Allows printing numbers with `_`s. For example, 1_234
Used in cli_utils for printing report totals with number formats.
@XAMPPRocky
Copy link
Owner

Thank you for your PR!

@XAMPPRocky XAMPPRocky merged commit f37b2db into XAMPPRocky:master Jul 21, 2020
@NickHackman NickHackman deleted the format_numbers branch July 21, 2020 22:51
@shilangyu
Copy link

Hey are there any plans to release it? It seems to be not available in the newest version on crates.io

@XAMPPRocky
Copy link
Owner

@shilangyu I’ll cut a release later this or next week.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optionally formatting numbers with a thousands separator
3 participants