469,630 Members | 1,225 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,630 developers. It's quick & easy.

Decimal Places

MAF
How can I set the number of decimal places for a double value?
Nov 15 '05 #1
1 2431
You have to be specific. If you want a string representing a double using
some number of decimal places, try

string str = myDouble.ToString ("F3");

to get 3 decimal places. Or look up String.Format
--
Mike Mayer
http://www.mag37.com/csharp/
mi**@mag37.com
"MAF" <mf*****@henwoodenergy.com> wrote in message
news:eM**************@TK2MSFTNGP10.phx.gbl...
How can I set the number of decimal places for a double value?

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Brent Bortnick | last post: by
8 posts views Thread by nick | last post: by
3 posts views Thread by mohaaron | last post: by
3 posts views Thread by David | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.