Fully working with the rule no explicit any
This commit is contained in:
@ -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'), '');
|
||||
|
||||
Reference in New Issue
Block a user