Line data Source code
1 : // Copyright 2023 The terCAD team. All rights reserved.
2 : // Use of this source code is governed by a CC BY-NC-ND 4.0 license that can be found in the LICENSE file.
3 :
4 : import 'package:app_finance/_classes/structure/currency/exchange.dart';
5 :
6 : abstract class AbstractRecalculation {
7 : late Exchange exchange;
8 :
9 : double getDelta();
10 :
11 1 : double getProgress(double amount, double progress, double delta, [double shift = 0]) {
12 2 : if (amount + shift != 0) {
13 4 : progress = (amount * progress + delta) / (amount + shift);
14 : } else {
15 : progress = 0.0;
16 : }
17 : return progress;
18 : }
19 : }
|