title: Neo4j Cypher round value
body: <p>I have the following Cypher:</p>
  
  <pre><code>MATCH (v:Value)-[:CONTAINS]-&gt;(hv:HistoryValue) 
  WHERE v.id = {valueId} 
  OPTIONAL MATCH (hv)-[:CREATED_BY]-&gt;(u:User) 
  WHERE {fetchCreateUsers} 
  WITH u, hv ORDER BY hv.createDate DESC 
  WITH count(hv) as count, count(hv) / {maxResults} as step, COLLECT({userId: u.id, historyValueId: hv.id, historyValue: hv.originalValue, historyValueCreateDate: hv.createDate}) AS data 
  RETURN REDUCE(s = [], i IN RANGE(0, count - 1, CASE step WHEN 0 THEN 1 ELSE step END) | s + data[i]) AS result, step, count
  </code></pre>
  
  <p>right now:</p>
  
  <pre><code>count(hv)  = 260
  {maxResults} = 100
  </code></pre>
  
  <p>The <code>step</code> variable equals 2 but I expect <code>round(260/100)</code> = 3 </p>
  
  <p>I tried the following <code>round(count(hv) / {maxResults}) as step</code> but <code>step</code> is still 2.</p>
  
  <p>How to fix my query in order to get a proper round (3 as <code>step</code> variable in this particular case)?</p>