NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #1078 most downloaded on crates.io
A Rust crate for producing string-representations of numbers, formatted according to international standards
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
Nothing published for this version
* Add github actions CI * Fix a few clippy lints
Update cldr-numbers-full git submodule to commit b52a87048985d3052f12d30d05cfe5423ad92709
Locale::from_str now supports underscore-delimited locales, e.g. "de_DE",
in addition to previously supported dash-delimiated locales, e.g "de-DE"One column per quarter.
Because SystemLocale requires a lot of dependencies (especially for Windows users), it's now only available behind a feature flag (with-system-locale)
Breaking changes:
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.Environment was renamed to SystemLocale.
Breaking changes:
Environment was renamed to SystemLocale.Error and ErrorKind were refactored.Bug fixes:
Enhancements:
available_names, from_name, and name were added to both Locale and SystemLocale.WriteFormatted was being unconditionally implemented on std::unix::UnixStream, which is a unix-only type; so we moved this implementation behind a #[c
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.…of types by users. Unfortunately this is a breaking change.
Breaking changes:
Flatten module structure
num_format::format and num_format::errors modules have been removed and all
of their containing types have been moved to the crate root.use num_format::errors::{Error, ErrorKind};
use num_format::format::{CustomFormat, Environment, Format, Locale};
use num_format::format::utils::{InfinityStr, MinusSignStr, NanStr};
use num_format::{CustomFormat, Environment, Error, ErrorKind, Format, Locale};
use num_format::utils::{InfinityStr, MinusSignStr, NanStr};
Refactor Error and ErrorKind
num_format::Error and num_format::ErrorKind to work with just plain old std::error::ErrorNew features:
impl From<Environment> and From<Locale> for CustomFormat
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(())
}
Initial release
Initial release
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →