copy_qty.Text = Q123.34;
copy_box.Text = 10;
string str_qty = copy_qty.Text.Substring(1);
decimal qty_val = decimal.Parse(str_qty);
int box_val = int.Parse(copy_box.Text);
decimal total = qty_val * box_val;
total_qty.Text = total.ToString();
i am getting 12334 in qty_val instead of 123.34,
how to parse string value into decimal ?
FYI,
i have also tried the below code but no luck,
string getnumber = "11.145";
decimal decinum = Convert.ToDecimal(getnumber);
getting 11145 instead of 11.145
any suggestion ?
Jignesh TrivediPosted Mar 17, 2015, 11:58 PM
Hi,
This is not possible but convert.Todecimal value depending upon current culture...
so please check current culture...
alos refer below link for how to pass culture
https://msdn.microsoft.com/en-us/library/9k6z9cdw(v=vs.110).aspx
hope this will help you.
Manish Kumar ChoudharyPosted Mar 17, 2015, 11:55 PM