|
-
May 21st, 2007, 05:33 AM
#4
Re: [2005] Rounding of Digits in a Double
1. How is that easier?
2. Your 'test1' variable is a Double, so why would you be converting a value that is already a Double to String? You'd only have to convert back again to a Double.
If you actually want a string, like to display in a Label or whatever then you can use myDouble.ToString("n2") or myDouble.ToString("f2"), but only do that if you catually want a string. Don't convert things to strings and back again without a very good reason. If there's a simple way to do what you want with the value's original type then that's what you should do.
Last edited by jmcilhinney; May 21st, 2007 at 05:36 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|