When converting string to floating, the converter creates wrong results.
I am working with VB.Net Visual Studio 2012, Framework 4 on ASP.Net Webpage.
Is there any solution for converting huge numbers from string into floating?
Best How To :
The result isn't wrong, it only has lower precision than you expected. Floating point numbers have a limited precision by design, and you simply can't expect to get a result that is more precise than its limit.
You can use a
Decimal to get higher precision. In this case it is enough for the number that you use:
double has a precision of 15-16 digits, and a
Decimal has a precision of 28-29 digits.
Decimal is strictly speaking not a floating point number, but a fixed precision number. It's an integer with a decimal scale, so for example the number 12.345 is stored as 12345 * 10-3