website/src/app/formulaManager/scale.pipe.ts

10 lines
269 B
TypeScript
Raw Normal View History

2018-06-25 00:50:47 -04:00
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;
}
}