rtrim and round functions unexpected result

Jose Isaias Cabrera <[email protected]> Thu, 20 Feb 2020 16:02:35 +0000
Newsgroups gmane.comp.db.sqlite.general
Message-ID <VI1P195MB076555E10F6D40165A619158DE130@VI1P195MB0765.EURP195.PROD.OUTLOOK.COM>
Greetings.

Please take a look at the following:
sqlite> select rtrim(round(1235.6));
1236.0
This is expected.
sqlite> select rtrim(round(1235.6),'.0');
1236
Also expected.
sqlite> select rtrim(round(1299.6),'.0');
13
is not expected.  I was hoping for 1300.  Also, just rtrim,
sqlite> select rtrim('1000.0','.0');
1
sqlite> select rtrim('1000.0','0');
1000.

I know I can use replace for this,

sqlite> select replace('10000.0','.0','');
10000

but I wanted to see if there was an explanation for it. By the way, escaping the period (.) or dot also fails.

sqlite> select rtrim('1000.0','\.0');
1

Thanks.

josé
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users