SQLite Forum

"Office Space"... I'm losing all those pennies
Login
> though I've never had to do that sort of gymnastics before with other DBs

Then those other DBs are not doing IEEE compliant computations using IEEE-754 Floating Point numbers.

You can do decimal arithmetic using the SQLite3 decimal extension <https://sqlite.org/floatingpoint.html> Section 2.2

```
sqlite> select decimal_mul('16.15', '100');
┌─────────────────────────────┐
│ decimal_mul('16.15', '100') │
├─────────────────────────────┤
│ 1615                        │
└─────────────────────────────┘
```

or by using a decimal extension (such as LifePillar's decimal extension)

```
sqlite> .load decimal
sqlite> select decStr(decMul(dec('16.15') , dec('100')));
┌───────────────────────────────────────────┐
│ decStr(decMul(dec('16.15'), dec('100'))) │
├───────────────────────────────────────────┤
│ 1615                                      │
└───────────────────────────────────────────┘
```