diff --git a/src/filters/dashOrCurrency.js b/src/filters/dashOrCurrency.js new file mode 100644 index 000000000..9873990ab --- /dev/null +++ b/src/filters/dashOrCurrency.js @@ -0,0 +1,6 @@ +import toCurrency from './toCurrency'; + +export default function (value) { + if (value == null || value === '') return () => '-'; + return toCurrency; +} diff --git a/src/filters/index.js b/src/filters/index.js index 43bfc2d40..940788ed1 100644 --- a/src/filters/index.js +++ b/src/filters/index.js @@ -10,6 +10,7 @@ import toLowerCamel from './toLowerCamel'; import dashIfEmpty from './dashIfEmpty'; import dateRange from './dateRange'; import toHour from './toHour'; +import dashOrCurrency from './dashOrCurrency'; export { toLowerCase, @@ -17,6 +18,7 @@ export { toDate, toHour, toDateString, + dashOrCurrency, toDateHourMin, toDateHourMinSec, toRelativeDate,