E
Ed S
I'm trying to format a double with this behavior:
1) should only show 8 characters (character count before and after
decimal added together).
2) if greater than 7 characters to the left of the decimal, should
display in scientific notation.
3) if 7 characters or less to the left of the decimal, should round the
characters to the right of the decimal so only 8 characters are shown.
Anyone have any idea how to do this with the Double.ToString() format
string? Obviously using "e" as the format argument to ToString() will
always produce scientific notation, but that's not what I want in all
cases. Examples of what I'd like are:
orignal value desired value
------------- -------------
123.0 123.0
1234567.891 1234567.9
123456789.987 1.23e+08
123.456789123 123.45679
Thanks in advance for any help
--Ed
1) should only show 8 characters (character count before and after
decimal added together).
2) if greater than 7 characters to the left of the decimal, should
display in scientific notation.
3) if 7 characters or less to the left of the decimal, should round the
characters to the right of the decimal so only 8 characters are shown.
Anyone have any idea how to do this with the Double.ToString() format
string? Obviously using "e" as the format argument to ToString() will
always produce scientific notation, but that's not what I want in all
cases. Examples of what I'd like are:
orignal value desired value
------------- -------------
123.0 123.0
1234567.891 1234567.9
123456789.987 1.23e+08
123.456789123 123.45679
Thanks in advance for any help
--Ed