[Python-Dev] How to round timestamps and durations? (original) (raw)
Georg Brandl g.brandl at gmx.net
Wed Feb 15 08:42:02 CET 2012
- Previous message: [Python-Dev] How to round timestamps and durations?
- Next message: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Am 13.02.2012 13:59, schrieb Victor Stinner:
Hi,
My work on the PEP 410 tries to unify the code to manipulate timestamps. The problem is that I'm unable to decide how to round these numbers. Functions using a resolution of 1 second (e.g. time.mktime) expects rounding towards zero (ROUNDHALFDOWN), as does int(float). Example:
FWIW, that's ROUND_DOWN. ROUND_HALF_DOWN rounds up from > x.5.
Georg
- Previous message: [Python-Dev] How to round timestamps and durations?
- Next message: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]