WordPress.org

Make WordPress Core

Ticket #10555: 10555_float_i18n.diff

File 10555_float_i18n.diff, 701 bytes (added by nacin, 4 years ago)
  • wp-includes/functions.php

     
    140140        // let the user override the precision only 
    141141        $decimals = ( is_null( $decimals ) ) ? $wp_locale->number_format['decimals'] : intval( $decimals ); 
    142142 
     143        // if the number is not floating point number set the number of decimals to zero 
     144        if ( !is_float( $number ) ) 
     145                $decimals = 0; 
     146 
    143147        $num = number_format( $number, $decimals, $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep'] ); 
    144148 
    145149        // let the user translate digits from latin to localized language