wondery Posted October 21, 2003 Posted October 21, 2003 (edited) my code is double Fee = Convert.ToDouble(dv3[0].Row[9].ToString()); lblFeeRate.Text = Fee.ToString(); double Rate = Convert.ToDouble(dv3[0].Row[10].ToString()); lblItem.Text = Rate.ToString(); double TRate = Convert.ToDouble(Fee*Rate); it retrun 135 and i want 135.00 how to ? thank for advance Edited October 21, 2003 by wondery Quote
wyrd Posted October 21, 2003 Posted October 21, 2003 Rate.ToString("###,###,##0.00") Quote Gamer extraordinaire. Programmer wannabe.
wondery Posted October 21, 2003 Author Posted October 21, 2003 i do double TRate = Convert.ToDouble((Fee*Rate).ToString("###,###,##0.00")); right ? it return 135 same above Quote
wondery Posted October 21, 2003 Author Posted October 21, 2003 ok i done lblTRate.Text = TRate.ToString("###,###,##0.00"); thank a lot Quote
*Experts* Nerseus Posted October 21, 2003 *Experts* Posted October 21, 2003 You can also use ToString("n2"). Increase the 2 if you want more/less decimals. Use ToString("f2") if you want the 2 decimals but no commas. -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.