how to convert string to float
my code is
float dec2DivId;
if (ddllist.SelectedIndex == 1)
{
if (TextBox1.Text != string.Empty)
{
dec2DivId = Convert.ToString(TextBox1.Text).ToString();
{
if (TextBox1.Text != string.Empty)
{
dec2DivId = Convert.ToString(TextBox1.Text).ToString();

Jignesh TrivediPosted Mar 31, 2014, 7:37 AM
hi,
try below code if you want to avoid any conversion error.
string data = "10.23";
double dou;
double.TryParse(data, out dou);
hope this will help you.
Lakshmanan Sethu SankaranarayanPosted Mar 31, 2014, 12:51 AM
Abhay ShankerPosted Mar 31, 2014, 12:35 AM
dec2DivId = Convert.ToDecimal(Convert.ToString(TextBox1.Text).ToString());