File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1313,8 +1313,10 @@ function displayExtensionsTable(extensions) {
13131313 console . log ( ansi . colorize ( ansi . bold + ansi . brightWhite , `Found ${ count } extension${ count !== 1 ? 's' : '' } :\n` ) ) ;
13141314
13151315 extensions . forEach ( ( ext , index ) => {
1316+ const rawPrice = ext . on_sale ? ext . sale_price : ext . price ;
1317+ const formattedPrice = ( rawPrice / 100 ) . toFixed ( 2 ) ;
13161318 const price = ext . payment_required
1317- ? ansi . colorize ( ansi . yellow , `$${ ext . on_sale ? ext . sale_price : ext . price } ${ ( ext . currency || 'USD' ) . toUpperCase ( ) } ` )
1319+ ? ansi . colorize ( ansi . yellow , `$${ formattedPrice } ${ ( ext . currency || 'USD' ) . toUpperCase ( ) } ` )
13181320 : ansi . colorize ( ansi . green , 'Free' ) ;
13191321
13201322 const installs = ansi . colorize ( ansi . dim , `\u2193 ${ ext . installs_count ?? 0 } ` ) ;
@@ -1406,7 +1408,8 @@ async function searchExtensionsCommand(query, options) {
14061408 // Simple one-per-line output mode (for scripting)
14071409 if ( options . simple ) {
14081410 extensions . forEach ( ext => {
1409- const price = ext . payment_required ? `$${ ext . on_sale ? ext . sale_price : ext . price } ` : 'free' ;
1411+ const rawPrice = ext . on_sale ? ext . sale_price : ext . price ;
1412+ const price = ext . payment_required ? `$${ ( rawPrice / 100 ) . toFixed ( 2 ) } ` : 'free' ;
14101413 console . log ( `${ ext . slug } \t${ ext . name } \tv${ ext . version || '?' } \t${ price } ` ) ;
14111414 } ) ;
14121415 return ;
You can’t perform that action at this time.
0 commit comments