[SOLVED] Find if a string is Number

I use mqtt topic to receive same info from client. I want to search in one string the first number after a point.
String :

{“StatusSNS”:{“Time”:“2018-06-11T15:05:38”,“Switch1”:“OFF”,“Switch2”:“OFF”,“ANALOG”:{“A0”:1024},“DHT11”:{“Temperature”:30.0,“Humidity”:13.0},“TempUnit”:“C”}}

from this and with substring function I want to see in the next letter is Number. So I check every letter if is Number before parsing it into Integer.
example: I want to take the temp, so stringname.substring(stringname.indexof(“temperature”)+14,stringname.indexof(“temperature”)+15) -->how to check if is a NUMBER?
Thnx in advance

Your string is a json string
Use the JSONPATH transform

Install the JSONPATH tranform in the PaperUI

Your item:

Number Temperature "Temperature [%0.1f]" { mqtt="<[broker:topic:state:JSONPATH($.StatusSNS.DHT11.Temperature)]" }
2 Likes

that was fast . thnx you saved my life