[gradsusr] Convert string to numeric?

Matt Bunkers - NWS Rapid City matthew.bunkers at noaa.gov
Sun Aug 6 12:13:38 EDT 2017


Hi Dan,

I didn't see your message until just now, but I tried what you said and it
worked.

Thanks,

-- Matt


On Sat, Aug 5, 2017 at 10:05 PM, dan martin <sailmaui at gmail.com> wrote:

> I do this and there's no quote marks. Try:
>
> BUFratio=BUFawips/BUFqpe
>
>
>
> On Sat, Aug 5, 2017 at 10:53 AM, Matt Bunkers - NWS Rapid City <
> matthew.bunkers at noaa.gov> wrote:
>
>> Hi,
>>
>> I have a text file with numbers that I'm reading into GrADS and then I
>> want to perform calculations with them.  However, the numbers I'm reading
>> won't work and I get an error that says I have non-numeric args to a
>> numeric operations, even though when I print my variable it shows 2.19.
>>
>> I've tried both of these options:
>>
>> 'define BUFratio='BUFawips'/'BUFqpe''
>> BUFratio='BUFawips'/'BUFqpe'
>>
>> Is there a command I can use to convert my "2.19" string to a number that
>> can be used in calculations?
>>
>> Thanks,
>>
>> -- Matt
>>
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20170806/1c192726/attachment.html 


More information about the gradsusr mailing list