posted 14 years ago
Hi All,
The below code is used to round upto two digits after decimal.
1.215 is rounded to 1.22(correct)
1.225 is rounded to 1.22(incorrect)
1.235 is rounded to 1.24(correct)
1.245 is rounded to 1.24(incorrect)
Output:
***1.215***
Rounding using Decimal Formatting:1.22
Rounding using Number Formatting:1.22
***1.225***
Rounding using Decimal Formatting:1.22
Rounding using Number Formatting:1.22
***1.235***
Rounding using Decimal Formatting:1.24
Rounding using Number Formatting:1.24
***1.245***
Rounding using Decimal Formatting:1.24
Rounding using Number Formatting:1.24
Please let me know the behavior of formatting .
Thanks in Advance.
Cheers
>