website/src/app/formulaManager/scale.pipe.ts
2018-07-03 10:10:47 -04:00

10 lines
269 B
TypeScript

import { PipeTransform, Pipe } from "@angular/core";
@Pipe({
name: 'scale'
})
export class ScalePipe implements PipeTransform {
transform(quantity: number, total: number, newTotal: number): number {
return quantity / total * newTotal;
}
}