FormatException: Input string was not in a correct format

Hello, I have a problem with lolicode, if someone can maybe help me it will be nice thanks you.

PS: the variable “balance” is egal to 184.12

BLOCK:Parse
LABEL:Parse balance
  input = @data.SOURCE
  jToken = "balanceValidated"
  MODE:Json
  => VAR @balance
ENDBLOCK

LOG @balance // output: 184.12

IF INTKEY @balance GreaterThanOrEqualTo 20
LOG @balance
END

Hello try like this instead :

BLOCK:Parse
LABEL:Parse balance
  input = @data.SOURCE
  jToken = "balanceValidated"
  MODE:Json
  => VAR @balance
ENDBLOCK

LOG @balance // output: 184.12

IF FLOATKEY @balance GreaterThanOrEqualTo 20
LOG @balance
END

If the operation did not work on your side, it is simply that your number is not an int but a float

Hello, thanks for your answer it’s work :slight_smile:

1 Like