| |
rahultvp
Posts: 1
Score: 0
Joined: 8/3/2003
From:
Status: offline
|
Hi all, I am devloping financial appilcation and i need to format the data to 2 decimal digit. At the same time i used format currency function to format the data which i displayed to user. My problem is inconsistency with "round" and "formatcurrency" function. Try to run the code in asp page and you will see the difference. <% response.Write "round (2162.505, 2)=" & round(2162.505, 2) & " " response.Write "round (2162.515, 2)=" & round(2162.515, 2) & " " response.Write "round (2162.505, 2)=" & formatcurrency(2162.505, 2) & " " response.Write "round (2162.515, 2)=" & formatcurrency(2162.515, 2) & " " %> Why the result is so inconsistent ? I have no idea how to solve this.... MS site says that "round" function 'round to even' and not 'round to larger'. But, how i make my application consistent... Any help...
|
|