fixes
This commit is contained in:
parent
ee1df7fee0
commit
31d3fe75d8
|
@ -707,8 +707,13 @@ export const priceFormatter = (price, pdp) => {
|
||||||
return Number(price).toFixed(2);
|
return Number(price).toFixed(2);
|
||||||
if (decimals.length == 2 && pdp) //if 2 or 2.1
|
if (decimals.length == 2 && pdp) //if 2 or 2.1
|
||||||
return price;
|
return price;
|
||||||
|
|
||||||
else if (decimals.length > 1) // if 2.34 or 2.56565
|
else if (decimals.length > 1) // if 2.34 or 2.56565
|
||||||
return Number(price.match(/^-?\d+(?:\.\d{0,4})?/)[0]);
|
{
|
||||||
|
return price.toString().match(/^-?\d+(?:\.\d{0,2})?/)[0]
|
||||||
|
}
|
||||||
|
// if 2.34 or 2.56565
|
||||||
|
// return Number(price.match(/^-?\d+(?:\.\d{0,4})?/)[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue