Works as specified.

The .width command sets the output width of a column to a certain number of 
characters;
 output that is shorter is padded on the right (or the left, if the width is 
negative);
 output that is too long is truncated.

Use the printf() function to define the format of real numbers.

-----Ursprüngliche Nachricht-----
Von: Stephan Buchert [mailto:stephanb...@gmail.com]
Gesendet: Montag, 19. Jänner 2015 11:53
An: sqlite-users@sqlite.org
Betreff: [sqlite] Malformatted output by sqlite3

(Prompt erased for easier paste and copy):

CREATE TABLE satpos(msec INTEGER, latitude REAL, longitude REAL); INSERT INTO 
satpos VALUES (86386217,-0.0318895369716216,-167.689719869132);
INSERT INTO satpos VALUES
(86386716,-2.93238037697483e-06,-167.690497310632);
INSERT INTO satpos VALUES (86387217,0.0319616241531195,-167.69127664905);
SELECT * FROM satpos;
86386217|-0.0318895369716216|-167.689719869132
86386716|-2.93238037697483e-06|-167.690497310632
86387217|0.0319616241531195|-167.69127664905

So far, so good, but:

.mode column
.width -8 -7 -8
SELECT * FROM satpos;
86386217  -0.0318  -167.689
86386716  -2.9323  -167.690
86387217  0.03196  -167.691

In the 2nd row, 2nd column "-0.0000" or "-2.9e-6" would make me happy. But 
"-2.9323" definitely messes up my stuff.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: h...@scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to