improve format
This commit is contained in:
parent
a1e637fead
commit
3116b46a6c
|
|
@ -5,6 +5,8 @@ export function useNumberFormat() {
|
||||||
const { i18n } = useTranslation();
|
const { i18n } = useTranslation();
|
||||||
|
|
||||||
return (number: number, digits = 2, currency = null) => {
|
return (number: number, digits = 2, currency = null) => {
|
||||||
|
if(number == undefined)
|
||||||
|
return null;
|
||||||
if (currency) {
|
if (currency) {
|
||||||
if ((Math.round(number * (10 ** digits)) / (10 ** digits)) === 0)
|
if ((Math.round(number * (10 ** digits)) / (10 ** digits)) === 0)
|
||||||
return "---";
|
return "---";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user