<p>This actually makes two changes:</p>

<ol>
<li>It makes it so that when {s.int} is performed on an empty string it returns 0. This was the old/original behavior that was changed by <a href="https://github.com/OpenSIPS/opensips/commit/4fdb55bfab9b7cfcc3dfbf15093e2becafe7ec4b" class="commit-link"><tt>4fdb55b</tt></a>
</li>
</ol>

<p>Not sure if it was intended to affect the transformation or not. While I think the change is good for the primary use of that function, for the script level transformation we should be more lax.</p>

<ol>
<li>{s.int} now also accepts a double/float and returns an int. It always truncates the number (e.g. 2.9 is 2, 2.3 is 2, -2.9 is -2, -2.3 is -2), which I think is a sane default. If someone needs more control over the rounding they can use the mathops module.</li>
</ol>

<p>See issue <a href="https://github.com/OpenSIPS/opensips/issues/788" class="issue-link js-issue-link" data-url="https://github.com/OpenSIPS/opensips/issues/788" data-id="133079575" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#788</a> for some a bit of discussion on making {s.int} more permissive.</p>

<p>Not sure where to update the documentation for the transformations. If someone can point me at the right spot I am glad to update the documentation as well to reflect these changes.</p>

<p>Thanks.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>&nbsp;&nbsp;<a href='https://github.com/OpenSIPS/opensips/pull/836'>https://github.com/OpenSIPS/opensips/pull/836</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Make s.int also operate on floats/doubles by truncating them to an int</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/836/files#diff-0">Makefile.defs</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/836/files#diff-1">transformations.c</a>
    (24)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/OpenSIPS/opensips/pull/836.patch'>https://github.com/OpenSIPS/opensips/pull/836.patch</a></li>
  <li><a href='https://github.com/OpenSIPS/opensips/pull/836.diff'>https://github.com/OpenSIPS/opensips/pull/836.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/pull/836">view it on GitHub</a><img alt="" height="1" src="https://github.com/notifications/beacon/AFOciSCETyZLfjSxcVR9inJHjik_ta9qks5pwCI1gaJpZM4H2UD-.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/OpenSIPS/opensips/pull/836"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>