Why can't we pass decimal prices with wix-pay?

Hello
I can’t pass a decimal value as price for custom payment creation using wix-pay

Here’s my code
backend
export function createMyPayment ( priceamount , userInfo ) {
let pricer = Number ( priceamount )
return wixPayBackend . createPayment ({
items : [{
name : “Product” ,
price : pricer ,
quantity : 1
}],
amount : pricer ,
userInfo : userInfo
});
}

frontend
let price = 2.99 ;
let userInfo = {
“firstName” : “firstName” ,
“lastName” : “lastName” ,
“phone” : “12345678” ,
“email” : “email@gm.co

} 
createMyPayment1 ( price , userInfo ) 
    . then (( payment ) => { 
        wixPay . startPayment ( payment . id ) 
            . then (( result ) => { 
                **if**  ( result . status  ===  "Successful" ) { 
                    // handle payment success 
                }  **else if**  ( result . status  ===  "Failed" ) { 
                    // handle payment failure 
                }  **else if**  ( result . status  ===  "Pending" ) { 
                    // handle payment pending 
                }  **else if**  ( result . status  ===  "Cancelled" ) { 
                    // handle user closing payment panel 

                } 
            }); 
    }); 

If I change 2.99 to 2, any whole number, it would work
but not like this
Get this error


I have tried rounding off the number and everything still does not work

Any help appreciated
Thanks

Hey Jennifer,

Looking through your code, and the examples which I see that you’re following, the only real difference that I see is that you haven’t included the field for the countryCode. https://www.wix.com/velo/reference/wix-pay-backend/createpayment

Other than that is the little difference between createMyPayment1 on the frontend code, vs createMyPayment on the backend.

I get the error only when I pass 2.99 as price
if its 2 (a whole number) it works