I have a query on a parameter that always returns a negative number, but as a string.
I need to convert that to an int
so that I can use it.
Parameter = InternetGatewayDevice.SystemConfig.Status.ModemStatus.RSRP
Value = -87 (as string)
For example, when I run my query an the parameter above, I get the return value of -87
presented as a string
.
How do I convert that string
to an integer
so that I can perform mathematical calculations on it?
3
This isn’t clear, could you elaborate your question?
Umm…. did you try
.to_i
? e.g.,"-87".to_i
. Just read a little of the Ruby documentation.I apologize, but my experience with ruby is only about 5 hours older than my original post. The problem I am trying to solve is that my return value is a string and I need it to be an integer so that I can do math on it. I hope that helps to clarify…