Fully working with the rule no explicit any

This commit is contained in:
2020-11-25 09:27:42 +05:30
parent 84535ca9bb
commit b583b90756
27 changed files with 223 additions and 155 deletions

View File

@ -5,16 +5,6 @@ import { evaluate, round } from 'mathjs';
providedIn: 'root',
})
export class MathService {
// eslint-disable-next-line class-methods-use-this
journalAmount(amount: string = '', debit: number): any {
const val = this.parseAmount(amount, 2);
let newDebit = debit;
if (val < 0) {
newDebit *= -1;
}
return { debit: newDebit, amount: Math.abs(val) };
}
// eslint-disable-next-line class-methods-use-this
parseAmount(amount: string = '', rounding: number = 2): number {
const cleaned = `${amount}`.replace(new RegExp('(₹[s]*)|(,)|(s)', 'g'), '');