-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershigh priorityHigh priorityHigh priority
Description
Question
I'd like to always write exactly three significant digits in the fractional part. It would seem that I need to include both min_significant_digits(...)
and max_significant_digits(...)
.
const FORMAT: u128 = lexical::format::STANDARD;
OptionsBuilder::new()
.max_significant_digits(NonZeroUsize::new(3))
.min_significant_digits(NonZeroUsize::new(3))
.build()
.unwrap();
lexical::to_string_with_options::<_, FORMAT>(val, &options)
However, this always fails with
---- algorithms::stage::test_stage stdout ----
thread 'algorithms::stage::test_stage' panicked at 'assertion failed: bytes.len() >= 20', C:\Users\nicho\.cargo\registry\src\github.com-1ecc6299db9ec823\lexical-write-float-0.8.5\src\algorithm.rs:807:5
What am I doing wrong? min_significant_digits(...)
alone seems to work ok.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershigh priorityHigh priorityHigh priority