SQLite Forum

sqlite3 rounding off the values of timestamp causing issues
Login
The value, when stored as a floating point value, and converted to hooman readable text, to 26 decimal places, is:

```
┌────────────────────────────────────────┐
│ printf('%!.26f', 1536273869.654473892) │
├────────────────────────────────────────┤
│ 1536273869.6544737815856933            │
└────────────────────────────────────────┘
sqlite>
```

The default conversion from REAL (IEEE-754 double precision floating point) to TEXT does not display digits of superfluous precision because it is generally assumed that if you do such conversions that you are not interested in accuracy but rather prettiness, otherwise you would have left the floating point value as a floating point value, which IS accurate.

Converting the REAL to TEXT with 9 digits after the decimal point yields:

```
┌───────────────────────────────────────┐
│ printf('%!.9f', 1536273869.654473892) │
├───────────────────────────────────────┤
│ 1536273869.654473782                  │
└───────────────────────────────────────┘
sqlite>
```

The difference is either because someone's compiler or hardware is not IEEE-754 compliant or the source used more precision than could be contained in an IEEE-754 double.