|
-
August 24th, 2011, 07:51 AM
#1
displaying value with Comma
hi,
how do i display a value with a comma
eg:
double value = 100000;
How do i save this number like 1,00,000.00 in order to save it to database.
please help.
Last edited by dskp; August 24th, 2011 at 08:19 AM.
-
August 24th, 2011, 09:03 AM
#2
Re: displaying value with Comma
 Originally Posted by dskp
hi,
how do i display a value with a comma
eg:
double value = 100000;
How do i save this number like 1,00,000.00 in order to save it to database.
please help.
1) What do you mean by "display a value"? Numeric values are not strings, or is the number already a string and you want to put commas in it?
2) Why do you want to save a formatted number to a database? What's wrong with just saving the unformatted number, and then let the program format the number any way it sees fit?
3) Related to 2), what if the locale doesn't use commas in numbers? For example, many European countries do not use comma for separating millions, thousands, etc. They use the "." character. That's why it doesn't make sense saving formatted number to a database.
Regards,
Paul McKenzie
-
August 24th, 2011, 09:06 AM
#3
Re: displaying value with Comma
If you save it to a numeric type field in a database, you don't want punctuation.
If you want commas and periods, as far as I know, you need to insert them yourself.
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
|