Closed ben-allen closed 4 months ago
@ben-allen this particular test is still not according to the spec for lacking other necessary fix
"numeric" is not a valid option value for "milliseconds", "microseconds" and "nanoseconds" based on the listed values in 4th "Values" column in https://tc39.es/proposal-intl-duration-format/#table-durationformat
My implementation will throw RangeError for this test because in step 17-f of 1.2.1 Intl.DurationFormat ( [ locales [ , options ] ] )
f. Let unitOptions be ? GetDurationUnitOptions(unit, options, style, valueList, digitalBase, prevStyle).
when unit is dfOpts = {microseconds: "numeric"}; or dfOpts = {nanoseconds: "numeric"};
Uncommented erroneously commented line, added roundingMode: 'trunc' to NumberFormat options when fractional digits are formatted to match behaviour of DurationFormat -- doesn't make a difference with these test values, but could with others