# HG changeset patch # User Surkov Sergey # Date 1515771234 -10800 # Node ID cded8d8a0485698e0e5c9ac60ca5691a4c79991a # Parent f41dc3829af69621fe8e7469f0238867548830d2 fix rounding milliseconds from nanoseconds example:rounding 299999 ns to 300ms, if division result is an integer, remainder will be lost, and result will be 299. diff -r f41dc3829af6 -r cded8d8a0485 targets/typemapping.py --- a/targets/typemapping.py Fri Jan 12 17:56:48 2018 +0300 +++ b/targets/typemapping.py Fri Jan 12 18:33:54 2018 +0300 @@ -54,7 +54,7 @@ def _ttime(): return (IEC_TIME, - lambda x: td(0, x.s, x.ns/1000), + lambda x: td(0, x.s, x.ns/1000.0), lambda t, x: t(x.days * 24 * 3600 + x.seconds, x.microseconds*1000))