[gradsusr] Rounding Numbers With Decimals

Jeff Duda jeffduda319 at gmail.com
Thu Nov 7 17:04:23 EST 2013


Anytime you use a script written by another person and you run into
problems, it's generally easiest and best to ask the script author since
they know the script better than anyone else.

However, from what you attached, I can see that you should probably use the
math_fmt() function instead to format the string of the value.  Use it to
reformat min_val before the second draw string command for each of the high
and low.

Jeff Duda


On Thu, Nov 7, 2013 at 3:46 PM, Perry, Aaron @ LSC
<Aaron.Perry at lsc.vsc.edu>wrote:

>  Thanks for the advice Stephen. I'm currently using mfhilo<http://gradsaddict.blogspot.com/2013/05/tutorial-draw-sea-level-pressure-map.html>to plot MSLP contours on top of my temp shaded contour. I just tried using
> the 'set dignum' option and it did not work. I still have MSLP values that
> have decimals, ex 1025.67.
>
> Is there something that I have to adjust/turn off within the script
> itself? I've attached the script to this email.
>
>    Onward and Upward,
>
> Aaron Perry
> Boston, MA
> Mobile: 617-780-4312
>     ------------------------------
> *From:* gradsusr-bounces at gradsusr.org [gradsusr-bounces at gradsusr.org] on
> behalf of Stephen McMillan [smcmillan at planalytics.com]
> *Sent:* Thursday, November 07, 2013 8:13 AM
> *To:* GrADS Users Forum
> *Subject:* Re: [gradsusr] Rounding Numbers With Decimals
>
>   Aaron,
>
>  If you're wanting to change the numbers displayed on screen (as with
> 'set gxout grid'), then use 'set dignum ...', e.g., 'set dignum 0' to drop
> the decimals before displaying the variable.
>
>  If you're wanting to change the numbers using 'set gxout print' then use
> 'set prnopts..', e.g., 'set prnopts %0.0f'' will drop the decimals when you
> display the variable.
>
>  Hope this helps...
> Stephen Mc
>
>
> On Wed, Nov 6, 2013 at 11:08 PM, Perry, Aaron @ LSC <
> Aaron.Perry at lsc.vsc.edu> wrote:
>
>>  Good Evening Everyone,
>>
>> I'm using OpenGrADS and I want to change MSLP values from say 1018.60mb
>> to just 1018mb; same thing for temperatures. Is there a way that I can do
>> this? I know that GrADS has a bunch of math functions but, I'm not sure
>> which one to use and how to tell it to reduce ANY displayed values with
>> decimals in them.
>>
>>    Onward and Upward,
>>
>> Aaron Perry
>> Boston, MA
>> Mobile: 617-780-4312
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>  ***************************************************
> The information contained in this e-mail message is intended only for the use of the recipient(s) named above and may contain information that is privileged, confidential, and/or proprietary.
>
> If you are not the intended recipient, you may not review, copy or distribute this message. If you have received this communication in error, please notify the sender immediately by e-mail, and delete the original message.
> ***************************************************
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Jeff Duda
Graduate research assistant
University of Oklahoma School of Meteorology
Center for Analysis and Prediction of Storms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20131107/600ea9c8/attachment.html 


More information about the gradsusr mailing list