mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
refactoring: trial balance sheet report. refactoring: general ledger report. refactoring: journal report. refactoring: P&L report.
13 lines
296 B
TypeScript
13 lines
296 B
TypeScript
|
|
|
|
export const formatNumber = (balance, { noCents, divideOn1000 }): string => {
|
|
let formattedBalance: number = parseFloat(balance);
|
|
|
|
if (noCents) {
|
|
formattedBalance = parseInt(formattedBalance, 10);
|
|
}
|
|
if (divideOn1000) {
|
|
formattedBalance /= 1000;
|
|
}
|
|
return formattedBalance;
|
|
}; |