Hi Prasad,
The difference is here:
> let $V2 := 0.0926
This value is of type xs:decimal.
<V2>0.0926</V2>
This value is untyped, and implicitly converted to a double (not a
decimal) value when being included in an arithmetic expression. As the
following example shows…
4 - 3.1, 4 - 3.1e0
…It’s often a difference if you work with decimals or doubles.
In your case, it may be best to explicitly convert your values before
doing the computations:
let $V1 := xs:decimal(data/V1)
let $V2 := xs:decimal(data/V2)
let $V3 := xs:decimal(data/V3)
let $V4 := xs:decimal(data/V4)
let $V5 := xs:decimal(data/V5)
let $V6 := xs:decimal(data/V6)
let $V7 := xs:decimal(data/V7)
return round(((( $V1 * $V2 )+( $V3 * $V4 )+( $V5 * $V6 ))div( $V1 +
$V3 + $V5 ))*10000)
Hope this helps,
Christian