-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test formatting when microseconds or nanoseconds are the first numeric-styled unit #4034
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't get all the way through this one, but I have a couple of questions:
- If I'm understanding correctly, GetDurationUnitOptions step 4 basically forces
{microseconds: 'numeric'}
and{nanoseconds: 'numeric'}
to{microseconds: 'fractional'}
and{nanoseconds: 'fractional'}
respectively. Do we need test coverage that these things produce the same output? .format(d.microseconds.toString() + decimalSeparator + d.nanoseconds.toString()))
seems OK for this particular input but it might be better to add.padStart(3, '0')
to be robust against someone editing the values ind
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finished going through it, and I don't have any additional comments besides what I wrote the other day.
5947d1e
to
b12d693
Compare
Added the padding for the fractional components -- good catch! With regard to testing for
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. fractional
not being a user-facing option was what I was missing!
b12d693
to
7a83352
Compare
If
microseconds
are the firstnumeric
-styled unit, they should be displayed as a fractional component of milliseconds. Likewise, ifnanoseconds
is the firstnumeric
-styled unit, they should be displayed as a fractional component of microseconds.