* feat(chalice): autocomplete return top 10 with stats * fix(chalice): fixed autocomplete top 10 meta-filters * fix(chalice): support low-density for cards
7 lines
289 B
Python
7 lines
289 B
Python
def get_step_size(startTimestamp, endTimestamp, density, decimal=False, factor=1000):
|
|
step_size = (endTimestamp // factor - startTimestamp // factor)
|
|
if density <= 1:
|
|
return step_size
|
|
if decimal:
|
|
return step_size / density
|
|
return step_size // (density - 1)
|