test for NaN price

This commit is contained in:
2023-04-24 08:22:29 +10:00
parent 967c14b93a
commit 44ccaf10d4

View File

@@ -364,7 +364,7 @@ const computedAges = (ages: string): string => {
*/ */
const computedPrice = (price: string): string => { const computedPrice = (price: string): string => {
const trimmed = parseInt(price.trim()); const trimmed = parseInt(price.trim());
if (trimmed == 0) { if (isNaN(trimmed) || trimmed == 0) {
return "Free"; return "Free";
} }