Skip to content

Commit

Permalink
Editorial: Add negative sign when value is 0
Browse files Browse the repository at this point in the history
To handle the case:
```js
new Intl.DurationFormat("en", {hoursDisplay: "always"}).format({hours: 0, seconds: -1})
```
which should output `"-0 hr, 1 sec"`.
  • Loading branch information
anba authored and ryzokuken committed Jan 11, 2024
1 parent 222c396 commit f5c07a9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec.emu
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ contributors: Ujjwal Sharma, Younies Mahmoud
1. If _value_ is not 0 or _display_ is not *"auto"* or _displayRequired_ is *"true"*, then
1. If _displayNegativeSign_ is *true*, then
1. Set _displayNegativeSign_ to *false*.
1. If _value_ is 0 and DurationRecordSign(_duration_) is -1, then
1. Set _value_ to ~negative-zero~.
1. Else,
1. Perform ! CreateDataPropertyOrThrow(_nfOpts_, *"signDisplay"*, *"never"*).
1. Perform ! CreateDataPropertyOrThrow(_nfOpts_, *"numberingSystem"*, _durationFormat_.[[NumberingSystem]]).
Expand Down

0 comments on commit f5c07a9

Please sign in to comment.