Skip to content

Commit

Permalink
add another data validation
Browse files Browse the repository at this point in the history
  • Loading branch information
bcolloran committed Oct 19, 2023
1 parent b02cd3c commit 04896b0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions web-common/src/lib/number-formatting/format-measure-value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ export const createMeasureValueFormatter = (
}

// finally, use the formatPreset.
return (value: number) =>
humanizer(
value,
(measureSpec.formatPreset as FormatPreset) ?? FormatPreset.HUMANIZE
);
const formatPreset =
measureSpec.formatPreset && measureSpec.formatPreset !== ""
? (measureSpec.formatPreset as FormatPreset)
: FormatPreset.HUMANIZE;
return (value: number) => humanizer(value, formatPreset);
};

0 comments on commit 04896b0

Please sign in to comment.