Rounding Numbers: Difference between revisions

m
typo
m (typo)
 
(One intermediate revision by the same user not shown)
Line 60: Line 60:


= Source =
= Source =
<source lang="dataflex">
  // ===========================================================================
  // ===========================================================================
  //
  //
Line 111: Line 112:
     (Number(Abs(nVal) / nVal) * 0.5 / (Number(10 ^ (iRnd min 8))) + nVal ;
     (Number(Abs(nVal) / nVal) * 0.5 / (Number(10 ^ (iRnd min 8))) + nVal ;
       / (Number(10 ^ (8 - (iRnd min 8)))) * (Number(10 ^ (8 - (iRnd min 8)))))
       / (Number(10 ^ (8 - (iRnd min 8)))) * (Number(10 ^ (8 - (iRnd min 8)))))
     / / Else, where the rounding precision is in the range -6 to -13, return:-
     // Else, where the rounding precision is in the range -6 to -13, return:-
     Function_Return ;
     Function_Return ;
       (Number(Abs(nVal) / nVal) * 0.5 * (Number(10 ^ (Abs(iRnd) min 13))) ;
       (Number(Abs(nVal) / nVal) * 0.5 * (Number(10 ^ (Abs(iRnd) min 13))) ;
Line 117: Line 118:
           * (Number(10 ^ 13)) * (Number(10 ^ ((Abs(iRnd) - 5) min 8))))
           * (Number(10 ^ 13)) * (Number(10 ^ ((Abs(iRnd) - 5) min 8))))
   End_Function
   End_Function
 
</source>


= Links =
= Links =