diff --git a/templates/meta-box.php b/templates/meta-box.php index 071ae61..5f0e586 100644 --- a/templates/meta-box.php +++ b/templates/meta-box.php @@ -43,14 +43,29 @@ usort( $channels, array( 'LBRYPress', 'channel_name_comp' ) ); $results = LBRY()->daemon->claim_search( $lbry_claim_id ); $init_bid = $results->items[0]->amount; + $support_amount = $results->items[0]->meta->support_amount; + if ( ( $support_amount < 0.001 ) ) { + ( $support_amount = '0' ); + } elseif ( ( $support_amount < 0.01 ) && ( $support_amount >= 0.001 ) ) { + ( $support_amount = '<0.01' ); + } elseif ( ( $support_amount <= 0.099 ) && ( $support_amount >= 0.01) ) { + ( $support_amount = number_format( floatval( $support_amount ), 2, '.', '' ) ); + } elseif ( ( $support_amount <= 0.999 ) && ( $support_amount >= 0.1 ) ) { + ( $support_amount = number_format( floatval( $support_amount ), 1, '.', '' ) ); + } else { + ( $support_amount = number_format( intval( $support_amount ) ) ); + } printf( '
' . __( 'Initial bid amount:', 'lbrypress' ) . ' ' . esc_html__( '%1$s', 'lbrypress' ) . '
+
' . __( 'Supports:', 'lbrypress' ) . ' + ' . esc_html__( '%2$s', 'lbrypress' ) . '' . __( 'Add', 'lbrypress' ) . '
' . __( 'LBRY channel published at:', 'lbrypress' ) . '
' . esc_html__( '%3$s', 'lbrypress' ) . '
' . __( 'License published under:', 'lbrypress' ) .'
' . esc_html__( '%5$s', 'lbrypress' ) . '
', $init_bid, + $support_amount, $lbry_published_channel, $chan_open_url, $lbry_published_license,