Re: Trimming down a number for certain digits that you want

From: Rick Brownrigg <brownrig_at_nyahnyahspammersnyahnyah>
Date: Mon Dec 02 2013 - 15:15:46 MST

Hi,

Which do you mean: numerically? Something like:

    a = 12333
    print(mod(a, 1000))

or in terms of a string:

   b = "12333"
   print(str_get_cols(b, -3, -1))

Check out the docs on str_get_cols() to understand whats going on there.

Hope that helps…
Rick

On Dec 2, 2013, at 3:05 PM, "A.J. Eiserloh" <arthur.eiserloh@gmail.com> wrote:

> Hi,
>
> Let's say I have a number: 12333
>
> How can I tell NCL that I only want the last 3 digits of this number (333)?
>
>
> --
> Arthur J. Eiserloh, Jr.
> San Jose State University
> Graduate Student
> Dept. of Meteorology and Climate Science
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Dec 2 15:16:26 2013

This archive was generated by hypermail 2.1.8 : Wed Dec 04 2013 - 20:42:38 MST