Treat null and undefined equally

This commit is contained in:
Michael Lange 2020-05-08 17:27:54 -07:00
parent 61a693c656
commit 60d9dd47f3
1 changed files with 2 additions and 2 deletions

View File

@ -15,9 +15,9 @@ export function formatPercentage(params, options = {}) {
let ratio;
let total = options.total;
if (total !== undefined) {
if (total != undefined) {
total = safeNumber(total);
} else if (complement !== undefined) {
} else if (complement != undefined) {
total = value + safeNumber(complement);
} else {
// Ensures that ratio is between 0 and 1 when neither total or complement are defined