Chore: Just made it look nicer

This commit is contained in:
2023-08-05 08:05:14 +05:30
parent 7843acea28
commit 9ad411af65
5 changed files with 17 additions and 17 deletions
@@ -113,22 +113,22 @@ export class ProductDetailComponent implements OnInit, AfterViewInit {
if (formValue === undefined) {
return;
}
const fraction = +(formValue.fraction ?? '0');
const fraction = Number(formValue.fraction);
if (fraction < 1) {
this.toaster.show('Danger', 'Fraction has to be >= 1');
return;
}
const productYield = +(formValue.productYield ?? '0');
const productYield = Number(formValue.productYield);
if (productYield < 0 || productYield > 1) {
this.toaster.show('Danger', 'Product Yield has to be > 0 and <= 1');
return;
}
const costPrice = +(formValue.costPrice ?? '0');
const costPrice = Number(formValue.costPrice);
if (costPrice < 0) {
this.toaster.show('Danger', 'Price has to be >= 0');
return;
}
const salePrice = +(formValue.salePrice ?? '0');
const salePrice = Number(formValue.salePrice);
if (salePrice < 0) {
this.toaster.show('Danger', 'Sale Price has to be >= 0');
return;