Number column
NumberColumn right-aligns its cell and formats the value as a number for the viewer’s locale. It is
sortable and filters as a number.
TextColumn::make('label')->label('Metric');NumberColumn::make('views')->label('Views')->compact()->sortable();NumberColumn::make('conversion')->label('Conversion') ->unit(NumberFormatUnit::Percent) ->decimals(1);- actionsLabel:null
- bulkActions:[]
- data:[{"conversion":12.8,"label":"Landing page","views":12400},{"conversion":6.4,"label":"Pricing","views":3820},{"conversion":1.1,"label":"Blog","views":1045000}]
- emptyLabel:null
- endpoint:null
- filters:[]
- layout:null
- lazy:false
- pagination:{"currentPage":null,"from":1,"hasMore":false,"lastPage":null,"mode":"none","nextPage":null,"perPage":null,"to":3,"total":3}
- perPageOptions:[]
- pinnableColumns:false
- query:{"filters":[],"mode":null,"page":1,"perPage":25,"search":"","sorts":[],"tableFilterIndicators":[],"tableFilters":{}}
- resizableColumns:false
- resizeIndicator:false
- searchable:false
- striped:false
- toolbar:[]
- align:"start"
- badge:null
- copyable:false
- date:null
- filter:null
- hiddenByDefault:false
- label:"Metric"
- link:null
- multiple:null
- options:[]
- pinned:null
- sortable:false
- toggleable:false
- width:"md"
- align:"end"
- compact:true
- copyable:false
- filter:null
- hiddenByDefault:false
- label:"Views"
- maximumFractionDigits:null
- minimumFractionDigits:null
- options:[]
- pinned:null
- sortable:true
- toggleable:false
- unit:null
- width:"md"
- align:"end"
- compact:false
- copyable:false
- filter:null
- hiddenByDefault:false
- label:"Conversion"
- maximumFractionDigits:1
- minimumFractionDigits:1
- options:[]
- pinned:null
- sortable:false
- toggleable:false
- unit:"percent"
- width:"md"
->decimals($min, $max?)fixes the fraction digits —->decimals(2)for exactly two, or->decimals(0, 2)for a min–max range.->unit(NumberFormatUnit::…)adds a locale-correct unit suffix —Percent,Kilogram,Byte, and the rest of theNumberFormatUnitcases. The value is rendered as-is with the unit appended — no scaling — so store12.8to render12.8%.->compact()renders large numbers compactly (1.2K,3.4M).->copyable()adds a click-to-copy affordance. It copies the raw value (1234.5), not the formatted text — what you want when pasting into a spreadsheet.
use Lattice\Ui\Enums\NumberFormatUnit;
NumberColumn::make('weight')->unit(NumberFormatUnit::Kilogram)->decimals(1);NumberColumn::make('downloads')->compact();For a currency amount, reach for the dedicated Money column.