I have a float of about 27 significant figures, when I call "ToString()" I get "6.8248054E+26", how do I get the exact normal value?
I know you want to display 27-digit significant figure and you use float
. You can always do like this:
f.ToString("F27");
But really, they just don't match. Consider using decimal
to achieve that precision:
decimal dc = 91.123142141230131231231M; //your 27-digit figure:
dc.ToString("F27");
var number = 0.111111111100000000000000000;
string result = String.Format("{0:#,0.###########################}", number);
This would show all decimals places up to the 27th, but omits all trailing zeros. So the above number would be displayed as 0.1111111111.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With