It is necessary for the SQLite query to print a delimited number. For example: 12345 -> 12 345. Does SQLite support any function for this purpose?
- 2imkho why to change something in base, change better in representation. - ermak0ff
- In the query, I merge the string with the number and output it and it turns out something like: 'Current sales: 12345' and you need 'Current sales: 12 435'. In presenting this kind of value is a bit hard to format, as I thought. - Timur Gazaleev
- As far as I know SQLite does not support this kind of out of the box. - Alex Krass
|
2 answers
SQLite is a query language, it would be superfluous to endow it with something not related to query building and selection of a database. And do not forget that he is still LITE, i.e. many of its possibilities are limited by the necessary
- Clearly thanks, I will look for other options - Timur Gazaleev
- In general, for the correct answer, it is accepted here to give a daw in gratitude for the help - P. Ilyin
|
Before saving or displaying a value, call this function:
private String addPadding(String s) { StringBuilder retVal; if (s.length() <= 3) { return s; } retVal = new StringBuilder(s); for(int i = retVal.length(); i > 0; i -= 3){ retVal.insert(i, " "); } return retVal.toString(); } - Timur asked if the value could be converted by means of SQLite. There is no need to bring the methods of other tools here - P. Ilyin
- Oh, the captain drew. If I realized that Timur asked, and I think he understood from the comments under the post that sqlite does not support such features. I just suggested a sane alternative solution. - Android Android
- You have such a big rating, probably you are here much longer than me .. So long that you forgot a couple of rules from ru.stackoverflow.com/tour - P. Ilyin
- Wow, really! Thanks for reminding me. Before going to bed instead of "Our Father," I will reread - Android Android
|