What locale?
The locale setting may influence character to numeric conversions at the C
language library level.

sqlite> SELECT CAST ('9223372036854775807 ' AS NUMERIC);
> 9.22337203685478e+18
> sqlite> SELECT CAST ('9223372036854775807' AS NUMERIC);
> 9223372036854775807
> Notice the trailing white space which makes the difference.


Although U.S. dollar users are used to the currency symbol to the left of
the digits; in some countries
the currency symbol is to the right of the digits and sometimes there is a
space between the digits and the currency symbol.

Currencies are often represented as decimals (except when accounting
systems use integer pennies) and so a trailing space
in some or all locales may trigger an assumption of either a monetary or
floating point value.

The locale could impact something as low level as an atoi() or atol() C
conversion functions.
https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_71/rtref/itol.htm#itol

"These members are 1 if the currency_symbol or int_curr_symbol strings
should precede the value of a monetary amount, or 0 if the strings should
follow the value. The p_cs_precedes and int_p_cs_precedes members apply to
positive amounts (or zero), and the n_cs_precedes and int_n_cs_precedes members
apply to negative amounts."
...
"These members are 1 if a space should appear between the currency_symbol
 or int_curr_symbol strings and the amount, or 0 if no space should appear.
The p_sep_by_space and int_p_sep_by_space members apply to positive amounts
(or zero), and the n_sep_by_space and int_n_sep_by_space members apply to
negative amounts."
https://www.gnu.org/savannah-checkouts/gnu/libc/manual/html_node/Currency-Symbol.html#Currency-Symbol

"In many European countries such as France, Germany, Greece, Scandinavian
countries, the symbol is usually placed after the amount (e.g., 20,50 €)."
Note space between amount and Euro symbol.
https://en.wikipedia.org/wiki/Currency_symbol

Scientific Linux is used at CERN and ETHZ and other European facilities?

So, my guess would be that the space after the number, plus certain locales
would reproduce the issue.


Jim Callahan
Callahan Data Science LLC
Orlando, FL



On Tue, Jan 23, 2018 at 10:22 AM, Ralf Junker <ralfjun...@gmx.de> wrote:

> On 23.01.2018 15:31, Richard Hipp wrote:
>
> I'm still unable to reproduce this problem.
>>
>
> sqlite3.exe from this ZIP:
>
>   https://www.sqlite.org/2018/sqlite-tools-win32-x86-3220000.zip
>
> Running on Windows 7:
>
> SQLite version 3.22.0 2018-01-22 18:45:57
> Enter ".help" for usage hints.
> Connected to a transient in-memory database.
> Use ".open FILENAME" to reopen on a persistent database.
> sqlite> SELECT CAST ('9223372036854775807 ' AS NUMERIC);
> 9.22337203685478e+18
> sqlite> SELECT CAST ('9223372036854775807' AS NUMERIC);
> 9223372036854775807
>
> Notice the trailing white space which makes the difference.
>
> Ralf
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to