[HIMA-73] Price formatting on details page of product

This commit is contained in:
Milos Jovanov
2019-02-14 07:54:51 +01:00
parent e89af62d22
commit 50cb0785b0

View File

@@ -127,10 +127,18 @@ export class ProductDetailsComponent implements OnInit {
',00 ' +
item.av[0].price.value.currency;
} else {
price =
let afterDecimal = item.av[0].price.value.value.toString().split('.')[1];
if (afterDecimal.length === 1) {
price =
item.av[0].price.value.value.toString().replace('.', ',') + '0' +
' ' +
item.av[0].price.value.currency;
} else {
price =
item.av[0].price.value.value.toString().replace('.', ',') +
' ' +
item.av[0].price.value.currency;
}
}
}