msgValue problem

I mean simpler data, like you have input x, and you expect output y, exact input and output values

sorry not able to understand what you saying.
Maybe you are saying something else and i am understanding something else.

I mean, can you provide the exact input that you give to this code and what is the expected output and what is current output?
(you will have to do some logging/debugging for that)

This code is working completely fine. I removed Moralis.Units.FromWei since the answer from the inside code will be in wei.
The problem is happening here

msgValue: 

it is not understanding the difference in wei or eth.

for the input value i logged 0.2 as input
and expected output should be 20000000000000000 in wei.
and it is correctly giving me the same result.

can you try with a hardcoded value for the msgValue parameter to see how it works?

yes already checked for that. still not working.
same result

how did you do it? if you send 1 as parameter what does it do?

yes for integers value like 1,2,3… it is working perfect.
Real problem happens when i am sending 1.2 or something else float value. It is saying invalid bigNumber provided to function.

ok, for 1.2 as parameter, what is current output for your code and what is the expected output?

or this doesn’t even work now because of that error?

no it is not working because of the error invalid Bignumber.

this works fine for me in vanilla JS:

Moralis.Units.Token(1.2, 18) + 0
=>
'12000000000000000000'

Yes but when i provide this value to msgValue it would say that i am send β€˜12000000000000000000’ eth to function not wei.


i should be able to provide value to function like i am providing it on etherscan. In fractional form. Only then it will work like it is working on etherscan.

what value you are providing when it says that you sent β€˜12000000000000000000’ eth ?

1200000… Itself but in wei

the value should be in Wei, I still don’t understand what is the issue.
maybe you can give a simpler example