Merge branch 'development' into feat/FE/US-163/TASK-188-193-198-slicing-expense-request-form

This commit is contained in:
ValdiANS
2025-11-14 13:41:47 +07:00
58 changed files with 4673 additions and 875 deletions
+23
View File
@@ -2,6 +2,7 @@ import moment from 'moment';
import 'moment/locale/id';
import { twMerge } from 'tailwind-merge';
import clsx, { ClassValue } from 'clsx';
import { ChangeEvent } from 'react';
// set locale globally
moment.locale('id');
@@ -29,6 +30,28 @@ export const formatNumber = (
}).format(value);
};
export function formatVechicleNumber(value: string): string {
let result = '';
for (let i = 0; i < value.length; i++) {
const curr = value[i];
const prev = value[i - 1];
// Cek apakah terjadi perpindahan dari huruf ke angka atau angka ke huruf
if (i > 0) {
const isCurrDigit = /\d/.test(curr);
const isPrevDigit = /\d/.test(prev);
if (isCurrDigit !== isPrevDigit) {
result += ' ';
}
}
result += curr;
}
return result.trim().replace(/\s+/g, ' ');
}
export const formatCurrency = (
value: number | bigint | Intl.StringNumericLiteral,
currency = 'IDR',