Skip to content

Calculate Pages

Information
Type Data Function
Namespace moxlib:api/helpers/data/calculate_pages
Versions 1.15+

Overview

Calculates the amount of pages target array has, with a page size of count.

Meant for use with Paginate.

Example

data modify storage moxlib:api/helpers/data/calculate_pages target set value [1,2,3,4,5,6,7,8,9]
data modify storage moxlib:api/helpers/data/calculate_pages count set value 3
function moxlib:api/helpers/data/calculate_pages
Output of storage moxlib:api/helpers/data/calculate_pages
{
  output: 3
}

API

Expects

Returns

Total amount of pages, for the given target.