N
Nathan Sokalski
I am using databinding to populate a dropdownlist with numeric values. Some
of the values have more decimal places than others, and I only want the
minimal number of decimal places necessary displayed. The only way I have
found to do this is to use the following for the DataTextFormatString
property:
"{0:0.######}"
This displays what I want for now, but if the number had more that 6 decimal
places, it would not work. Is there any way to have the number of decimal
places determined and displayed automatically? My data is coming from an SQL
Server 2005 database, and the field in question is declared as numeric(7,5).
I realize that this field can never have more than 5 decimal places, but I
would think there would be a more efficient and easier way to say "Only
display the necessary decimal places". Thanks.
of the values have more decimal places than others, and I only want the
minimal number of decimal places necessary displayed. The only way I have
found to do this is to use the following for the DataTextFormatString
property:
"{0:0.######}"
This displays what I want for now, but if the number had more that 6 decimal
places, it would not work. Is there any way to have the number of decimal
places determined and displayed automatically? My data is coming from an SQL
Server 2005 database, and the field in question is declared as numeric(7,5).
I realize that this field can never have more than 5 decimal places, but I
would think there would be a more efficient and easier way to say "Only
display the necessary decimal places". Thanks.