Skip to content

Commit

Permalink
Remove unicode from number #955
Browse files Browse the repository at this point in the history
  • Loading branch information
girishpanchal30 committed Oct 27, 2022
1 parent 9ec8081 commit 308337e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions classes/Visualizer/Source.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ protected function _normalizeData( $data ) {
}
switch ( $series['type'] ) {
case 'number':
$data[ $i ] = preg_replace( '/[\x{200B}-\x{200D}\x{FEFF}]/u', '', $data[ $i ] );
$data[ $i ] = ( is_numeric( $data[ $i ] ) ) ? floatval( $data[ $i ] ) : ( is_numeric( str_replace( ',', '', $data[ $i ] ) ) ? floatval( str_replace( ',', '', $data[ $i ] ) ) : null );
break;
case 'boolean':
Expand Down

0 comments on commit 308337e

Please sign in to comment.