Re: bug with decimalPlaces?

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed Nov 02 2011 - 19:10:57 MDT

    x = -0.774
    c = 10.0
    xt = toint(x*c)/c
    print(xt) ; -0.7

On 11/2/11 4:51 PM, Kerrie Geil wrote:
> I can't seem to get decimalPlaces to truncate using ncl 6.0.
>
> test=decimalPlaces(-0.774,1,False)
> print(test)
> above yields -0.8
>
> test=decimalPlaces(0.774,1,False)
> print(test)
> above yields 0.8
>
> Passing the argument "False" should result in truncation which should
> yield +/- 0.7, but the function seems to be rounding instead of
> truncating. Same results as above if I pass "True" for rounding.
>
> Is this an error on my part or a bug? If it is a bug, is there another
> function I can use to truncate to one decimal place?
>
> Thanks,
>
> Kerrie Geil
> Master's Student
> Department of Atmospheric Sciences
> University of Arizona
> PAS Building Rm 526
> 1118 E 4th Street
> Tucson, AZ 85721
>
>
>
> _______________________________________________
> 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 Wed Nov 2 19:11:03 2011

This archive was generated by hypermail 2.1.8 : Fri Nov 04 2011 - 08:43:41 MDT