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.
Printable View
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
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.