File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/internal-packages/schema/lib/component Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,11 @@ class Type extends React.Component {
103103 } ;
104104 const subtypes = this . _getArraySubTypes ( ) ;
105105 const label = < span className = "schema-field-type-label" > { this . props . name } </ span > ;
106- const tooltipText = `${ this . props . name } (${ numeral ( this . props . probability ) . format ( '0%' ) } )` ;
106+ // show integer accuracy by default, but show one decimal point accuracy
107+ // when less than 1% or greater than 99% but no 0% or 100%
108+ const format = ( this . props . probability > 0.99 && this . props . probability < 1.0 )
109+ || ( this . props . probability > 0 && this . props . probability < 0.01 ) ? '0.0%' : '0%' ;
110+ const tooltipText = `${ this . props . name } (${ numeral ( this . props . probability ) . format ( format ) } )` ;
107111 const tooltipOptions = {
108112 'data-for' : TOOLTIP_IDS . SCHEMA_PROBABILITY_PERCENT ,
109113 'data-tip' : tooltipText ,
You can’t perform that action at this time.
0 commit comments