Hello,
I’m trying to setup a automated rule to get the price and calculate the total value of my rdd.
The only thing that isnt working is the calculation part, i get this error:
[ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule ‘rdd’: For input string: “0.00631479”
This is my rule:
rule "rdd"
when
Time cron "0 0/1 * * * ?"
then
var String HTTPString = "https://api.cryptonator.com/api/ticker/rdd-usd"
var jsonString = HTTPString.sendHttpGetRequest(10000)
var valusd = transform("JSONPATH","$.ticker.price",jsonString)
logInfo("RDD Value is $",valusd)
var amount = 18792.4;
var aantal = amount.toString()
logInfo("Total amount $",aantal)
var prijs = Integer::parseInt(valusd.toString)
var Number totval = amount*prijs
logInfo("Total wallet value: $",totval.toString)
rdd.sendCommand(prijs)
rddown.sendCommand(aantal)
rddval.sendCommand(totval)
end
Help would be appreciated