|
-
January 3rd, 2003, 11:39 AM
#1
Format Problem
Hi!
I need a number to be Formated as user defines.But Vb's Format command does not do anything.
I need the number to format like this:
#,##,##0.00
But Vb's format function returs me in the format
###,##0.00
Can I get the above format by Vb's format function if yes how?
Thanks
-
January 4th, 2003, 10:33 AM
#2
the VB help implies (obviously incorrectly) that you can do what you are trying to do, but you can't, so you'll have to roll your own. Check on planetsourcecode; maybe someone has already done it.
phinds
vs2008, 3.5SP1 Version 9.0.21022.8 RTM
-
January 4th, 2003, 10:53 AM
#3
I do not see where the VB information would imply any such thing, the comma character is explicitly stated as the THOUSANDS seperator.
The ',' character serves two purposes. First, if the format string contains a ',' character between two digit placeholders (0 or #) and to the left of the decimal point if one is present, then the output will have thousand separators inserted between each group of three digits to the left of the decimal separator. The actual character used as the decimal separator in the output string is determined by the NumberGroupSeparator property of the current NumberFormatInfo object that controls formatting.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions 
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
-
January 4th, 2003, 10:58 AM
#4
I do not see where the VB information would imply any such thing
you are obviously correct. I didn't read the verbiage and misinterpreted the code. Thank you for point it out. The only thing I hate more than being wrong is being wrong and not knowing it.
phinds
vs2008, 3.5SP1 Version 9.0.21022.8 RTM
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
|