beremiz
Clone
Summary
Browse
Changes
Graph
fix rounding milliseconds from nanoseconds
2018-01-12, Surkov Sergey
cded8d8a0485
Parents
f41dc3829af6
Children
b9318fc8f033
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.
1 files changed, 1 insertions(+), 1 deletions(-)
+1
-1
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))