You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As described in the documentation, the proposal champions' intention was
for rounding of exact times to consider the Big Bang as the "zero" point,
rather than the arbitrary zero point of the Unix epoch. The spec text
didn't reflect this correctly.
_roundingMode_: *"ceil"*, *"floor"*, *"trunc"*, or *"halfExpand"*,
785
+
): an integer
786
+
</h1>
787
+
<dlclass="header">
788
+
<dt>description</dt>
789
+
<dd>
790
+
It rounds _x_ to the nearest multiple of _increment_, up or down according to _roundingMode_, but always as if _x_ were positive.
791
+
For example, *"floor"* and *"trunc"* behave identically.
792
+
This is used when rounding exact times, where "rounding down" conceptually always means towards the beginning of time, even if the time is expressed as a negative amount of time relative to an epoch.
793
+
</dd>
794
+
</dl>
795
+
<emu-alg>
796
+
1. Let _quotient_ be _x_ / _increment_.
797
+
1. Let _unsignedRoundingMode_ be GetUnsignedRoundingMode(_roundingMode_, *false*).
798
+
1. Let _r1_ be the largest integer such that _r1_≤_quotient_.
799
+
1. Let _r2_ be the smallest integer such that _r2_>_quotient_.
800
+
1. Let _rounded_ be ApplyUnsignedRoundingMode(_quotient_, _r1_, _r2_, _unsignedRoundingMode_).
801
+
1. Return _rounded_×_increment_.
802
+
</emu-alg>
803
+
<emu-notetype="editor">
804
+
<p>
805
+
The rounding modes accepted by this abstract operation are intended to be the same as whatever is eventually standardized in the <ahref="https://github.com/tc39/proposal-intl-numberformat-v3">Intl.NumberFormat V3</a> proposal.
0 commit comments