[ncl-talk] Is string numeric?

Dave Allured - NOAA Affiliate dave.allured at noaa.gov
Tue Mar 22 09:44:18 MDT 2016


Carl,

Thanks for publishing this function.  I have wanted this for a while, but
never got around to making one.  It is very handy for working with real
world text data with the possibility of formatting problems.

--Dave


On Tue, Mar 22, 2016 at 9:34 AM, Carl Schreck <cjschrec at ncsu.edu> wrote:

> Turns out it wasn't too hard to make a quick and dirty function for this.
> It will miss some things, but probably good enough.
>
> Thanks!
> Carl
>
>
> On Mon, Mar 21, 2016 at 2:09 PM, Carl Schreck <cjschrec at ncsu.edu> wrote:
>
>> Is there a function that would tell me if a string is a numeric? i.e.,
>> contains no letters and "tofloat" won't give a warning on it?
>>
>> If not, has anyone already made one? Thanks!
>>
>> e.g.:
>> str_is_numeric( "215" ) => True
>> str_is_numeric( "21.5" ) => True
>> str_is_numeric( "21e5" ) => True
>> str_is_numeric( "21N5" ) => False
>>
>> Carl
>>
>> --
>>
>> <http://www.cicsnc.org/>
>> <http://www.researcherid.com/rid/B-8711-2011>
>> * Cyclone <http://www.cyclonecenter.org/>*Center.org
>> <http://www.cyclonecenter.org/>   *Carl J. Schreck III, PhD*
>> *Research Scholar / Research **Assistant Professor*
>> Cooperative Institute for Climate and Satellites NC (CICS
>> <http://www.cicsnc.org/>*-NC) <http://www.cicsnc.org/> /*
>> Department of Marine, Earth, and Atmospheric Sciences (MEAS)
>> <https://meas.sciences.ncsu.edu/>
>> North Carolina State University <http://ncsu.edu/>
>> NOAA National Centers for Environmental Information (NCEI)
>> <http://ncei.noaa.gov/>
>> 151 Patton Ave, Asheville, NC 28801
>> e: carl_schreck at ncsu.edu
>> o: +1 828 257 3140
>> c: +1 828 484 1702
>> Publications
>> <http://scholar.google.com/citations?hl=en&user=th8ONEcAAAAJ&view_op=list_works&sortby=pubdate>
>> monitor.cicsnc.org/mjo
>>
>
>
>
> --
>
> <http://www.cicsnc.org/>
> <http://www.researcherid.com/rid/B-8711-2011>
> * Cyclone <http://www.cyclonecenter.org/>*Center.org
> <http://www.cyclonecenter.org/>   *Carl J. Schreck III, PhD*
> *Research Scholar / Research **Assistant Professor*
> Cooperative Institute for Climate and Satellites NC (CICS
> <http://www.cicsnc.org/>*-NC) <http://www.cicsnc.org/> /*
> Department of Marine, Earth, and Atmospheric Sciences (MEAS)
> <https://meas.sciences.ncsu.edu/>
> North Carolina State University <http://ncsu.edu/>
> NOAA National Centers for Environmental Information (NCEI)
> <http://ncei.noaa.gov/>
> 151 Patton Ave, Asheville, NC 28801
> e: carl_schreck at ncsu.edu
> o: +1 828 257 3140
> c: +1 828 484 1702
> Publications
> <http://scholar.google.com/citations?hl=en&user=th8ONEcAAAAJ&view_op=list_works&sortby=pubdate>
> monitor.cicsnc.org/mjo
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160322/5dbdf00d/attachment.html 


More information about the ncl-talk mailing list