Decimal

functional

Choose decimal places, grouping, and negative style so fractional values read cleanly.

For fractional values, Settings › Results › Decimal lets you choose a presentation that matches the people reading the result. It covers decimal, numeric, money, float, real, and double columns.

OptionChoicesDefault
Decimal placesFixed precision, 0 to 206
Thousands separatorsOn / offOn
Decimal separatorPeriod (1.23) / Comma (1,23)Period
Thousands separatorComma / Period / Space / Apostrophe / NoneComma
Reduce large numbersAbbreviate to K / M / G / T / P (with threshold)Off
Negative formatMinus sign / ParenthesesMinus sign
AlignmentLeft / Center / RightRight
SQLly
SQLly decimal formatting configuration panelSQLly decimal formatting configuration panel
The decimal formatting panel in Settings.

What the grid shows

The same value, 1234567.891, under a few combinations:

SettingsGrid shows
Defaults (6 places, separators on)1,234,567.891000
2 places1,234,567.89
2 places, thousands separators off1234567.89
2 places, Parentheses, value -1234567.891(1,234,567.89)
0 places1,234,568
2 places, Decimal separator Comma, Thousands separator Period1.234.567,89
2 places, Decimal separator Comma, Thousands separator Space1 234 567,89
2 places, Thousands separator Apostrophe1'234'567.89
2 places, Thousands separator None1234567.89
Reduce large numbers on (threshold 1000)1.23M
Reduce large numbers on, Decimal separator Comma1,23M

Six places suits measurements and rates but is a lot for money: a money value of 19.99 shows as 19.990000 until you lower the default or override the column. Places are padded and rounded for display only; the stored value is untouched.

Reduce large numbers

With Reduce large numbers on, decimal cells at or above the Metric threshold are abbreviated with K, M, G, T, or P and two decimals, using your decimal separator: 2340000 shows as 2.34M, or 2,34M with a comma separator. Values under the threshold keep your decimal places, so 999.5 shows as 999.500000 by default. The letters always mean thousand, million, billion, trillion, and quadrillion; the threshold only decides where abbreviation starts.

Where each option applies

OptionGrid cells and the Settings sampleSelection summary
Decimal placesYesYes
Thousands separators (on / off)YesYes
Thousands separator characterYesYes
Decimal separatorYesNo - always a period
Reduce large numbers, Metric thresholdYesNo - the summary keeps full figures
Negative formatYesYes
AlignmentYes-

The selection summary is the Count, Sum, Avg, Min, Max, and Distinct line under the grid when you select numeric cells. Every option here is display only: the cell keeps the exact number, so sorting and numeric filters use it, while a text filter matches the text you see (1.234.567,89, 1.23M).

One column at a time

Right-click a decimal column's header for two kinds of quick change:

  • Format › Rounding: 0 / 1 / 2 / 4 / 6 decimals changes just this grid, right now. It keeps the column's other settings and is not written anywhere, handy for a quick look.
  • Format › Set Formatting Override… offers 2, 4, or 6 decimal places and No grouping, and saves the choice into the query so it applies on every run.
-- sqlly format: column=UnitPrice; number=2; thousands=true
-- sqlly format: column=Discount; number=1; style=percent
SELECT ProductName, UnitPrice, Discount
FROM order_lines;

With those lines, UnitPrice 1234.5 shows as 1,234.50 and a Discount of 0.15 shows as 15.0%. A number= rule sets the places and grouping and keeps the column's other decimal settings - the decimal and thousands characters, Negative format, and Alignment, so with a comma decimal separator and a period thousands separator the same UnitPrice shows as 1.234,50. Fixed places also means the column is never abbreviated, even with Reduce large numbers on.

Currency and percent are per-column choices, not decimal defaults. Percent is a Number override style (it multiplies by 100 and adds %), alongside fixed and bytes. There is no currency style: a Template such as {value|prefix:$} adds a symbol, but a column takes one override at a time, so the template works on the raw value without decimal formatting.

Precision and copying

  • Very long decimals. The grid draws decimal values through a 64-bit floating-point number, so a decimal(38,10) with more than about 15 significant digits can display slightly rounded.
  • Copy and export keep every digit. Copy, the Copy as… formats, and file exports use the value the database sent, not the formatted text, on screen copies as 1234567.891 if that is what is stored. See Export.
  • NULL is never formatted; it shows as an italic NULL.