On Sun, Nov 22, 2015 at 10:34 AM, Simon Slavin <slavins at bigfraud.org> wrote:

>
> On 22 Nov 2015, at 3:34pm, Bruce Hohl <brucehohl at gmail.com> wrote:
>
> > printf
> > support for a thousands separator would be nice
>
> One problem with thousand separators is that different countries use
> different characters for them.  There's an unholy mix of commas, spaces,
> dots and apostrophes out there, not to mention whether people want a comma
> or U+066C.  C has access to your locale so it can get it right, but SQLite
> doesn't, and some people are bound to feel that whatever it implements is
> wrong.  The use of a point for decimals is part of SQL92 (which talks about
> 'decimal point' not 'decimal separator') but a thousands separator isn't.
>
> I also have to point out that printf is not going to be used by the
> majority of users.  SQLite is a database.  Its job is to store and retrieve
> data.  Formatting for print can be done in whatever programming language
> you're calling SQLite from.  Or 'awk' or 'sed' if you're writing a shell
> script.
>
> If you can rewrite existing printf code to be more compact and squeeze in
> more of the standard features at the time, great.  But to enlarge the code
> for every user of SQLite for a feature few people use may be seen as time
> and bytes better spent elsewhere.
>

All technically correct (except the implication that a thousands separator
format is standard, as it is not). But the OP wants to be able to do
formatting from within SQL as he is using the SQLite shell, thus there is
no programming language at his disposal in this use case. An understandable
wishlist item, even if it isn't likely to happen for equally understandable
reasons.
-- 
Scott Robison

Reply via email to