tursodatabase / turso-cli

Command line interface to Turso.
https://turso.tech
MIT License
215 stars 35 forks source link

CLI outputs numbers with string length >= 7 using scientific notation #175

Closed CodingDoug closed 1 year ago

CodingDoug commented 1 year ago
$ turso db shell d1 "select 123456"
123456
123456

$ turso db shell d1 "select 1234567"
1234567
1.234567e+06
haaawk commented 1 year ago

The problem is in the library we're using (https://github.com/rodaine/table). It prints values using the default formatter with fmt.Sprint:

v := strings.Split(fmt.Sprint(val), "\n")

It does not seem to have an option to pass a different formatter. What I can do is format the float64 value to string before passing it to the library.