Conversation
|
I'm happy to do a quick patch release with the necessary APIs to ixdtf if @nekevss can propose what they should look like |
|
😕 hmmmmm So some background: the formatting logic I was potentially going to see if there was any interest in upstreaming into So baseline a baseline option: we could just remake the functionality in With that being said, if there were any constructor added. It may be a good idea to at minimum upstream the impl Fraction {
fn from_value_with_precision(value: u64, precision: Option<Precision>) -> Option<Fraction> {
match precision {
None if value == 0 => None,
None => todo!(), // Derive digit precision from the length of value
Some(Precision::Minute) => None,
Some(Precision::Digit(digit)) => Fraction { digit, value },
}
}
}Although in this scenario, Precision::Digit would probably need to be a NonZeroU8. |
|
Will rebase since this also bumps ICU4X, just to see that it merges cleanly. |
I can't figure out how to construct a
fraction, do we need to add APIs upstream?It may also be worth it to add a direct
.to_milliseconds_and_microseconds()API to Fraction.