Merge pull request #34 from tnt-dev/fix-floor
Rename floor/1 to flooring/1
This commit is contained in:
commit
4c91fc4c01
1 changed files with 6 additions and 6 deletions
|
@ -1070,7 +1070,7 @@ deregister_format(Key) ->
|
|||
|
||||
|
||||
unixtime_to_now(T) when is_integer(T) ->
|
||||
MegaSec = floor(T/1000000),
|
||||
MegaSec = flooring(T/1000000),
|
||||
Secs = T - MegaSec*1000000,
|
||||
{MegaSec,Secs,0}.
|
||||
|
||||
|
@ -1078,10 +1078,10 @@ unixtime_to_date(T) ->
|
|||
Now = unixtime_to_now(T),
|
||||
calendar:now_to_datetime(Now).
|
||||
|
||||
floor(N) when N >= 0 ->
|
||||
trunc(N);
|
||||
floor(N) when N < 0 ->
|
||||
Int = trunc(N),
|
||||
flooring(N) when N >= 0 ->
|
||||
erlang:trunc(N);
|
||||
flooring(N) when N < 0 ->
|
||||
Int = erlang:trunc(N),
|
||||
if
|
||||
Int==N -> Int;
|
||||
true -> Int-1
|
||||
|
@ -1323,7 +1323,7 @@ compressed_parser(_) ->
|
|||
|
||||
microsoft_parser(FloatDate) when is_float(FloatDate) ->
|
||||
try
|
||||
DaysSince1900 = floor(FloatDate),
|
||||
DaysSince1900 = flooring(FloatDate),
|
||||
Days0to1900 = calendar:date_to_gregorian_days(1900,1,1),
|
||||
GregorianDays = Days0to1900 + DaysSince1900,
|
||||
Date = calendar:gregorian_days_to_date(GregorianDays),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue