-
About 2 years ago, you folks helped me modify boc_circle_counter to include a decimal point on the number entered. It works fine for number like 8.2% but truncates the decimal point and value for anything with 2 digits like 18.2%. What would I need to change to show 99.9% instead of 99%? Is it the class circ_counter_text_holder causing the truncation?
// Register Shortcode if( ! function_exists( 'shortcode_boc_circle_counter' ) ) { function shortcode_boc_circle_counter( $atts, $content = null ) { $atts = vc_map_get_attributes('boc_circle_counter', $atts ); extract( $atts ); $id = rand(0,10000); if(!$custom_color) { $color = boc_get_main_color(); } if($centered) { $css_classes .= ' center'; } if($angle) { $css_classes .= ' half_circle'; } if($size == 120) { $css_classes .= ' small_counter'; } elseif($size == 80) { $css_classes .= ' large_counter'; } //EC Added the following modification for decimal numbers (removed (int)) //<canvas width='.esc_attr($size).' height='.esc_attr($size).' data-end-nu="'.(int) $number.'"></canvas> //<div class="circ_counter_text_holder"><span class="circ_counter_text" id="circ_counter_text'.$id.'"></span><span class="counter_percent_sign heading_font">%</span></div> $str = '<div class="circ_numbers_holder '.esc_attr($css_classes).' '.($white_text ? "white_text" : "").'"> <div class="circ_counter" data-color="'.esc_attr($color).'" data-angle="'.esc_attr($angle).'" data-size="'.esc_attr($size).'" data-white_text="'.($white_text ? "1" : "0").'"> <canvas width='.esc_attr($size).' height='.esc_attr($size).' data-end-nu="'.$number.'"></canvas> <div class="circ_counter_text_holder"><span class="circ_counter_text" id="circ_counter_text'.$id.'"></span><span class="counter_percent_sign heading_font">%</span></div> <div class="circ_counter_desc">'.wp_kses_post($title).'</div> </div> </div>'; return $str; } add_shortcode('boc_circle_counter', 'shortcode_boc_circle_counter');
- Theme support is offered to verified customers only. To post a topic go to your Theme Category and add your question at the page bottom.
Theme Categories
Recent Topics
- PHP 8.5.9 Fatal errors and warnings in Fortuna theme
- Alea updates
- Why "Fortune" theme is no longer available?
- PHP 8.1 Error
- Issue with WPB editor icons
- Issue with Icons and Text Alignment for Arabic Content
- Installing and Activating Plugin Fortuna Portfolio CPT (1/8)
- Testimonials page is blank
- warning boc_framework line 905
- Transparent header issue without changes