Skip to content
Advertisement

Why do i get minus function error in cloud function node js?

I use bignumber in nodejs for cloud functions with firebase.I added BigNumber at the end thinking that it might help.

JavaScript

I get this error in Cloud Function Log TypeError:

Price.minus is not a function

Advertisement

Answer

Your typeof Price might be a string. So it needs to be converted to BigNumber. You can use TotalPrice with BigNumber static method itself. (thanks to your comment replies)

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement