PackageTrack
Sign in Get early access

num-format

A Rust crate for producing string-representations of numbers, formatted according to international standards

0.4.4 66M downloads/mo #1051 most downloaded on crates.io bcmyers/num-format

What this package is like to depend on

Last release 4 years ago

no release in 18 months

Ships unpredictably

gaps range from 2 weeks to 3.6 years

Most releases are documented

notes for 7 of 10 stable releases

Nothing withdrawn

no release was ever pulled

8 years old

10 releases · first in 2019

0 releases in the last 12 months

see the full history below

Release timeline

10 releases · Feb 2019 to Dec 2022
2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 10
  1. 0.4.4 03 Dec 2022

    Nothing published for this version

  2. 0.4.3 10 Oct 2022
    Release notes
    • Add github actions CI
    • Fix a few clippy lints
    Open source →
  3. 0.4.2 09 Oct 2022
    Release notes
    Open source →
  4. 0.4.0 20 Feb 2019
    Release notes

    Breaking changes:

    • Because SystemLocale requires a lot of dependencies (especially for Windows users), it's now only available behind a feature flag (with-system-locale). The upside is, of course, that those using num-format without this feature will only need to download and compile a small handful of dependencies.
    Open source →
  5. 0.3.0 19 Feb 2019
    Release notes

    Breaking changes:

    • Environment was renamed to SystemLocale.
    • Error and ErrorKind were refactored.
    • Compiling for Windows depends on bindgen and so requires Clang 3.9 or above.

    Bug fixes:

    • num-format now works on Windows!

    Enhancements:

    • Major overhaul of the code that interacts with operating systems (linux, macOS, freebsd, Windows, etc.)
    • Methods available_names, from_name, and name were added to both Locale and SystemLocale.
    • Several error messages now provide more detail about what exactly went wrong.
    Open source →
  6. 0.2.1 07 Feb 2019
    Release notes

    Bug fixes:

    • WriteFormatted was being unconditionally implemented on std::os::unix::net::UnixStream, which is a unix-only type; so we moved this implementation behind a #[cfg(unix)] flag.
    Open source →
  7. 0.2.0 07 Feb 2019
    Release notes

    Breaking changes:

    • Flatten module structure

      • We decided to flatten the module structure of num-format to both improve code readabiity and to simplify the importing of types by users. Unfortunately this is a breaking change.
      • The num_format::format and num_format::errors modules have been removed and all of their containing types have been moved to the crate root.
      • So whereas one used to do this:
      use num_format::errors::{Error, ErrorKind};
      use num_format::format::{CustomFormat, Environment, Format, Locale};
      use num_format::format::utils::{InfinityStr, MinusSignStr, NanStr};
      
      • one now does this:
      use num_format::{CustomFormat, Environment, Error, ErrorKind, Format, Locale};
      use num_format::utils::{InfinityStr, MinusSignStr, NanStr};
      
    • Refactor Error and ErrorKind

      • Since the future of the failure crate is up in the air, we decided to remove it as a dependency, refactoring num_format::Error and num_format::ErrorKind to work with just plain old std::error::Error
      • Thank you BurntSushi for the suggestion

    New features:

    • impl From<Environment> and From<Locale> for CustomFormat

      • Now you can easiliy turn an Environment or a Locale into a CustomFormat; so it's easy to start with an already complete "base" format and then just tweak it slightly to the custom format you want.
      use num_format::{CustomFormat, Error, Locale, ToFormattedString};
      
      fn main() -> Result<(), Error> {
          let format = CustomFormat::from(Locale::en_IN)
              .into_builder()
              .separator(Some(' '))
              .build()?;
          let s = 1_000_000.to_formatted_string(&format);
          assert_eq!(&s, "10 00 000");
          Ok(())
      }
      
    Open source →
  8. 0.1.2 05 Feb 2019
    Release notes

    Initial release

    Open source →
  9. 0.1.1 05 Feb 2019

    Nothing published for this version

  10. 0.1.0 05 Feb 2019

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive