Thanks Ross,
Yes there is the difference in values in my question and my code.But I think you have got my problem right.
Conversion to 'double ' is the right way but ,this is the exiting code which i am working on ,which was coded by other team and our team is facing a problem due to this.
I actually want to know wht happens internally which causes this rounding problems.Is there any documentation to explain...
User Profile
Collapse
-
Converting A String To Single and the Assigning IT To Double.
I am Converting a string value to single and then to double.
For 1371818.28 i am getting Answer 137181.28125
For 1371818.29 i am getting Answer 137181.296875
Below is the code i am using.
string a="137181.28" ;
double r=Convert.ToSin gle(a);
Response.Write( r);
Why I am getting this greater value.
No activity results to display
Show More
Leave a comment: