mirror of
https://github.com/felipegcoutinho/openmonetis.git
synced 2026-03-10 04:51:47 +00:00
refactor: remover código morto e exports não utilizados
Remove 6 componentes não utilizados (dashboard-grid, expenses/income by category widgets, installment analysis panels, fatura-warning-dialog). Remove funções/tipos não utilizados: successResult, generateApiToken, validateApiToken, getTodayUTC/Local, formatDateForDb, getDateInfo, calculatePercentage, roundToDecimals, safeParseInt/Float, isPeriodValid, getLastPeriods, normalizeWhitespace, formatCurrency wrapper, InboxItemInput, InboxBatchInput, ProcessInboxInput, DiscardInboxInput, LancamentosColumnId, 5 funções de anticipation-helpers. Redireciona imports de formatCurrency para lib/lancamentos/formatting-helpers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -24,28 +24,3 @@ export function calculatePercentageChange(
|
||||
// Protege contra valores absurdos (retorna null se > 1 milhão %)
|
||||
return Number.isFinite(change) && Math.abs(change) < 1000000 ? change : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates percentage of part relative to total
|
||||
* @param part - Part value
|
||||
* @param total - Total value
|
||||
* @returns Percentage (0-100)
|
||||
*/
|
||||
export function calculatePercentage(part: number, total: number): number {
|
||||
if (total === 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (part / total) * 100;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rounds number to specified decimal places
|
||||
* @param value - Value to round
|
||||
* @param decimals - Number of decimal places (default 2)
|
||||
* @returns Rounded number
|
||||
*/
|
||||
export function roundToDecimals(value: number, decimals: number = 2): number {
|
||||
const multiplier = 10 ** decimals;
|
||||
return Math.round(value * multiplier) / multiplier;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user