Skip to content

Commit

Permalink
Replace undefined with zeros for missing cell count (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamie256 committed Mar 23, 2022
1 parent 1567bfe commit cdf4037
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1090,12 +1090,18 @@ <h1 class="no-responsive__title">Hold on! :)</h1>

Handlebars.registerHelper("missingCells", function (properties) {
const {value, newValue, suffixe} = abbreviate_number(referenceProfile.properties.missing_cells)
return numberWithSuffixe(value, valueNumber(newValue), valueNumber(suffixe));
if (typeof value !== 'undefined' && typeof newValue !== 'undefined' && typeof suffixe !== 'undefined' ) {
return numberWithSuffixe(value, valueSuffixe(`(${newValue}%)`), suffixe);
}
return numberWithSuffixe(0, valueNumber(0), valueNumber(''));
});

Handlebars.registerHelper("missingCellsPercentage", function (properties) {
const {value, newValue, suffixe} = abbreviate_number(referenceProfile.properties.missing_percentage)
return numberWithSuffixe(value, valueSuffixe(`(${newValue}%)`), suffixe);
if (typeof value !== 'undefined' && typeof newValue !== 'undefined' && typeof suffixe !== 'undefined' ) {
return numberWithSuffixe(value, valueSuffixe(`(${newValue}%)`), suffixe);
}
return numberWithSuffixe(0, valueSuffixe(`(${0}%)`), '');
});

Handlebars.registerHelper("getProfileTimeStamp", function (properties) {
Expand Down

0 comments on commit cdf4037

Please sign in to comment.