Skip to content

Commit 6178e12

Browse files
handle forced invalid precision
1 parent f507750 commit 6178e12

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

classes/Visualizer/Gutenberg/build/block.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

classes/Visualizer/Gutenberg/src/Components/DataTable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class DataTables extends Component {
130130
if ( settings.series[index].format.decimal ) {
131131
parts[1] = settings.series[index].format.decimal;
132132
}
133-
if ( settings.series[index].format.precision && '0' != settings.series[index].format.precision ) {
133+
if ( settings.series[index].format.precision && 0 < parseInt( settings.series[index].format.precision ) ) {
134134
parts[2] = settings.series[index].format.precision;
135135
}
136136
if ( settings.series[index].format.prefix ) {

js/render-datatables.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@
248248
if(typeof series.format.decimal !== ''){
249249
parts[1] = series.format.decimal;
250250
}
251-
if(typeof series.format.precision !== '' && series.format.precision != '0'){
251+
if(typeof series.format.precision !== '' && parseInt(series.format.precision) > 0){
252252
parts[2] = series.format.precision;
253253
}
254254
if(typeof series.format.prefix !== ''){

0 commit comments

Comments
 (0)