@@ -91,7 +91,7 @@ <h3 id="title"></h3>
9191 return time / 1000000000 ;
9292 }
9393
94- function fmt_delta ( to , delta ) {
94+ function fmt_delta ( to , delta , is_integral_delta ) {
9595 let from = to - delta ;
9696 let pct = ( to - from ) / from * 100 ;
9797 if ( from == to ) {
@@ -110,7 +110,12 @@ <h3 id="title"></h3>
110110 if ( Math . abs ( delta ) <= 0.05 ) {
111111 classes = "neutral" ;
112112 }
113- let text = delta . toFixed ( 3 ) ;
113+ let text ;
114+ if ( is_integral_delta ) {
115+ text = delta . toString ( ) ;
116+ } else {
117+ text = delta . toFixed ( 3 ) ;
118+ }
114119 if ( pct != Infinity && pct != - Infinity ) {
115120 text += `(${ pct . toFixed ( 1 ) } %)` . padStart ( 10 , ' ' ) ;
116121 } else {
@@ -260,13 +265,13 @@ <h3 id="title"></h3>
260265 }
261266 td ( row , to_seconds ( cur . self_time ) . toFixed ( 3 ) ) ;
262267 if ( delta ) {
263- td ( row , fmt_delta ( to_seconds ( cur . self_time ) , to_seconds ( delta . self_time ) ) , true ) ;
268+ td ( row , fmt_delta ( to_seconds ( cur . self_time ) , to_seconds ( delta . self_time ) , false ) , true ) ;
264269 } else {
265270 td ( row , "-" , true ) ;
266271 }
267272 td ( row , cur . invocation_count ) ;
268273 if ( delta ) {
269- td ( row , fmt_delta ( cur . invocation_count , delta . invocation_count ) , true ) ;
274+ td ( row , fmt_delta ( cur . invocation_count , delta . invocation_count , true ) , true ) ;
270275 } else {
271276 td ( row , "-" , true ) ;
272277 }
@@ -277,6 +282,7 @@ <h3 id="title"></h3>
277282 fmt_delta (
278283 to_seconds ( cur . incremental_load_time ) ,
279284 to_seconds ( delta . incremental_load_time ) ,
285+ false ,
280286 ) ,
281287 true ) . classList . add ( "incr" ) ;
282288 } else {
0 commit comments