-2
I need to fix this mistake:
"Can not deserialize value of type java.lang.Integer
from String "R$5,000.00": not a Valid Integer value".
I need to transform the string parameter (R$ 5,000.00) to integer (5000).
Treatment I started:
var valorAplicacao = vm.valor.replace('R$ ', '').split(".").join("").replace(',', '.');
valorAplicacao = parseFloat(valorAplicacao);
The error ta kind of clear, there is no integer value being passed, but a string. "R$" is not number.
– user28595
Another thing, will the result always be an integer? Ex: if the string is
R$ 5,23
, the result will be whole (5
) or float (5.23
)?– hkotsubo
The error seems to be java but the code seems to be javascript. Confirm this situation in your question.
– Isac
Guys, Ricardo Pontual’s solution is the most viable. It worked normally.
– aleestevao