File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,10 @@ export const SmartInputComponent = (
9191
9292 // Decide what to display.
9393 const display = value ?. getDisplay ( ) ;
94- const prec = precisionFromPv ? ( display ?. precision ?? precision ) : precision ;
94+ // In Phoebus, default precision -1 seems to usually be 3. The toFixed functions
95+ // cannot accept -1 as a valid answer
96+ let prec = precisionFromPv ? ( display ?. precision ?? precision ) : precision ;
97+ if ( prec === - 1 ) prec = 3 ;
9598
9699 let displayedValue ;
97100 if ( ! value ) {
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ export const ProgressBarComponent = (
6868 label = "Check min and max values" ;
6969 } else {
7070 if ( precision ) {
71- label = numValue . toFixed ( precision ) ;
71+ label = numValue . toFixed ( precision === - 1 ? 3 : precision ) ;
7272 } else {
7373 label = numValue . toString ( ) ;
7474 }
Original file line number Diff line number Diff line change @@ -99,7 +99,10 @@ export const ReadbackComponent = (
9999
100100 // Decide what to display.
101101 const display = value ?. getDisplay ( ) ;
102- const prec = precisionFromPv ? ( display ?. precision ?? precision ) : precision ;
102+ // In Phoebus, default precision -1 seems to usually be 3. The toFixed functions
103+ // cannot accept -1 as a valid answer
104+ let prec = precisionFromPv ? ( display ?. precision ?? precision ) : precision ;
105+ if ( prec === - 1 ) prec = 3 ;
103106
104107 let displayedValue ;
105108 if ( ! value ) {
You can’t perform that action at this time.
0 commit comments