I am building a small project that allows a user to get funding for a project.
A project has a field called “amount_raised” that might house an integer such as “123.34”
when a successful payment is done through paypal you receive the ipn_obj of which one contains some financial info, i.e. ipn_obj.mc_gross which might be “10.23”
how do I perform a calculation in django to get the total value of that?
It’s the first time I have dealt with calculations in django so bear with me.
If I try converting them to integers I get an error invalid literal for int() with base 10
Your help is much appreciated.
A number like 123.45 is not an integer. What you need is a DecimalField. Example usage: