File tree Expand file tree Collapse file tree
src/component/panels/PeaksPanel Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,10 +110,10 @@ export function usePeaksTableColumns(activeTab: string) {
110110 accessor : ( row ) => row ?. shape ?. fwhm || '' ,
111111 Cell : ( { row } : CellProps < PeakRecord > ) => {
112112 const fwhm = row . original ?. shape ?. fwhm ;
113- if ( fwhm ) {
114- return formatNumber ( fwhm , tablePreferences . fwhm . format ) ;
113+ if ( typeof fwhm !== 'number' ) {
114+ return '' ;
115115 }
116- return '' ;
116+ return formatNumber ( fwhm , tablePreferences . fwhm . format ) ;
117117 } ,
118118 } ,
119119 {
@@ -126,10 +126,10 @@ export function usePeaksTableColumns(activeTab: string) {
126126 const mu =
127127 row . original ?. shape ?. kind === 'pseudoVoigt' &&
128128 row . original ?. shape ?. mu ;
129- if ( mu ) {
130- return formatNumber ( mu , tablePreferences . mu . format ) ;
129+ if ( typeof mu !== 'number' ) {
130+ return '' ;
131131 }
132- return '' ;
132+ return formatNumber ( mu , tablePreferences . mu . format ) ;
133133 } ,
134134 } ,
135135 {
@@ -143,10 +143,12 @@ export function usePeaksTableColumns(activeTab: string) {
143143 const gamma =
144144 row . original ?. shape ?. kind === 'generalizedLorentzian' &&
145145 row . original ?. shape ?. gamma ;
146- if ( gamma ) {
147- return formatNumber ( gamma , tablePreferences . gamma . format ) ;
146+
147+ if ( typeof gamma !== 'number' ) {
148+ return '' ;
148149 }
149- return '' ;
150+
151+ return formatNumber ( gamma , tablePreferences . gamma . format ) ;
150152 } ,
151153 } ,
152154 {
You can’t perform that action at this time.
0 commit comments