The number of sleeps left is always one more than the number of days as it is rounded up instead of down.
The Christmas Countdown projects give two values for the number of days left until Christmas:
days left
- rounded downsleeps left
- rounded upBoth numbers are correct but in different circumstances.
For example, if you are saying “there are d days and h hours left”, the rounded down value (days
) would be correct.
However, if you just want the number of days left until Christmas, it makes more sense to use the value that is rounded up (sleeps
).
This way there will be 1 sleep left on Christmas Eve, instead of saying 0 days.
The number of sleeps left is the number of days left, but rounded up. It is just a different name to avoid confusion between the two numbers.
The Christmas Countdown bot for Discord’s countdown feature gives the number of sleeps left as the message is sent early in the morning at the start of each day. Using the rounded down value would ignore what is left of today, which is the majority of the day.
The number of days and sleeps left are both calculated by dividing the number of seconds until Christmas by the number of seconds in one day. This gives a floating point number which is then rounded up or down to give sleeps or days.
Here’s an example:
Unrounded: 94.92745791666667
Rounded up: "95 sleeps"
Rounded down: "94 days"