#Help me with this anyone
11 messages · Page 1 of 1 (latest)
Here are two ways of doing this:
You can use the Number() function. Example: Number(item.product.price)
OR
You can use the parseInt function. Example: parseInt(item.product.price)
Try these out and see if it fixes the error
Here's the Mozilla docs on parseInt if you need more examples: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt
still same
The same error? Property 'toNumber' does not exist on type 'number'.ts(2339)?
Argument of type 'number' is not assignable to parameter of type 'string'.ts(2345)
Which of the two methods did you use? Number() or parseInt()?
To me it seems like item.product.price is already a number
it was number i have to put () at the end