The below technique is use to show n number decimal places without rounding.
For Example you have the Value 3.6970976 and the requirement is show till first two decimals without rounding 3.69.
First multiply the vlaue with 100
3.6970976 *100=369.70976
Convert the above value into interger
cast(369.70976,integer)=369
Finally divide the above value with 100
369/100= 3.69
No comments:
Post a Comment