{precision=>p} to reduce byte count
parent
f14417f32a
commit
9dbda93b4f
|
@ -267,7 +267,7 @@
|
|||
<text>var result=</text>
|
||||
<!-- if caller wants to yield a vector, don't cast -->
|
||||
<sequence select="if ( not( $dim gt 0 ) ) then
|
||||
concat( 'precision(', $precision, ', +(')
|
||||
concat( 'p(', $precision, ', +(')
|
||||
else
|
||||
'('" />
|
||||
<choose>
|
||||
|
@ -442,7 +442,7 @@
|
|||
|
||||
<text>Math.</text>
|
||||
<value-of select="local-name()" />
|
||||
<text>(precision(</text>
|
||||
<text>(p(</text>
|
||||
<value-of select="$precision" />
|
||||
<text>, +(</text>
|
||||
<apply-templates select="./c:*" mode="compile" />
|
||||
|
|
|
@ -1402,7 +1402,7 @@
|
|||
|
||||
<!-- store the premium -->
|
||||
<value-of select="$store" />
|
||||
<text>=precision(</text>
|
||||
<text>=p(</text>
|
||||
<value-of select="$precision" />
|
||||
<!-- return the result of the calculation for this rate block -->
|
||||
<text>,+(</text>
|
||||
|
@ -1654,7 +1654,8 @@
|
|||
<template name="compiler:static">
|
||||
<text>
|
||||
<![CDATA[
|
||||
function precision(p, x)
|
||||
// precision
|
||||
function p(p, x)
|
||||
{
|
||||
if (x % 1 === 0) return x;
|
||||
return Math.round(x * p) / p;
|
||||
|
|
Loading…
Reference in New Issue