@@ -28,6 +28,17 @@ function isNumeric(value) {
2828 ! isNaN ( parseFloat ( value ) ) ;
2929}
3030
31+ function formatNumberWithCommas ( value : number | string ) : string {
32+ if ( value == null || value === '' ) {
33+ return '' ;
34+ }
35+ const num = typeof value === 'string' ? parseFloat ( value ) : value ;
36+ if ( isNaN ( num ) ) {
37+ return value . toString ( ) ;
38+ }
39+ return num . toLocaleString ( ) ;
40+ }
41+
3142const METRICS_TYPES = [ 'COUNT_RECORDS' , 'AGGREGATION_BY_FIELD' ] ;
3243const METRICS_TYPES_NAMES = [ t ( Strings . count_records ) , t ( Strings . select_y_axis_field ) ] ;
3344
@@ -111,7 +122,7 @@ const Summary = ({ openSetting, formData }) => {
111122 const { targetValue, note } = formData ?. chartStyle || { } ;
112123 // When the statistical value and the target value can be calculated, the scale is displayed.
113124
114- let targetText : string = `${ targetValue } ` ;
125+ let targetText : string = `${ formatNumberWithCommas ( targetValue ) } ` ;
115126 const resizeObserverRef = useResize ( resizeHandler , [ note , targetValue , targetText , currentValue . text ] ) ;
116127 let v = Number ( currentValue . value . toString ( ) . replaceAll ( "," , "" ) )
117128 const showPercent = isNumeric ( targetValue ) && isNumeric ( v ) ;
@@ -127,7 +138,7 @@ const Summary = ({ openSetting, formData }) => {
127138 < CurrentValueWrapper color = { color } >
128139 { currentValue . text }
129140 </ CurrentValueWrapper >
130- < Typography variant = "body1 " >
141+ < Typography variant = "h3 " >
131142 { targetValue && targetText }
132143 </ Typography >
133144 </ div >
0 commit comments