- Implemented CuttingIndex component for listing and managing cuttings. - Added routes for cutting management in web.php. - Created CuttingTest for testing cutting-related features including authorization, validation, and stock management. - Updated roles create and edit pages to include necessary imports. - Refactored settings and profile pages to streamline imports. - Enhanced permissions checks for cutting management actions.
21 lines
598 B
TypeScript
21 lines
598 B
TypeScript
export function formatRupiah(value: number): string {
|
|
return value.toLocaleString('id-ID');
|
|
}
|
|
|
|
export function formatRupiahShort(value: number): string {
|
|
if (value >= 1_000_000_000) {
|
|
return (value / 1_000_000_000).toFixed(1).replace('.0', '') + 'jt';
|
|
}
|
|
if (value >= 1_000_000) {
|
|
return (value / 1_000_000).toFixed(1).replace('.0', '') + 'jt';
|
|
}
|
|
if (value >= 1_000) {
|
|
return (value / 1_000).toFixed(0) + 'rb';
|
|
}
|
|
return value.toString();
|
|
}
|
|
|
|
export function formatRupiahDisplay(value: number): string {
|
|
return 'Rp' + formatRupiah(value);
|
|
}
|