diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2015-01-21 11:06:06 +0100 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2015-01-21 11:06:06 +0100 |
commit | 18d9f18642907c9baafa3a3cb887cebb12fc6bcb (patch) | |
tree | e68a96ca3829b48ef03477bf218678bd571bcaaf /src | |
parent | Fix overflow in XEP-0203 delay: if microseconds exceeded 999499, *** was put ... (diff) |
Don't match integer() against float() value
Diffstat (limited to 'src')
-rw-r--r-- | src/jlib.erl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/jlib.erl b/src/jlib.erl index 9cafe3215..6397335e5 100644 --- a/src/jlib.erl +++ b/src/jlib.erl @@ -717,7 +717,7 @@ now_to_utc_string({MegaSecs, Secs, MicroSecs}, Precision) -> {{Year, Month, Day}, {Hour, Minute, Second}} = calendar:now_to_universal_time({MegaSecs, Secs, MicroSecs}), - Max = math:pow(10, Precision), + Max = round(math:pow(10, Precision)), FracOfSec = case round(MicroSecs / math:pow(10, 6 - Precision)) of Max -> Max - 1; % don't overflow io_lib:format X -> X |