Skip to main content

page_of_position

Function page_of_position 

Source
pub fn page_of_position(position: f64, per_page: u32) -> u32
Expand description

The SERP page a position falls on, given per_page results per page.

Page numbering starts at 1. A per_page of 0 is treated as 1.

assert_eq!(serp_ctr::page_of_position(10.0, 10), 1);
assert_eq!(serp_ctr::page_of_position(11.0, 10), 2);