This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
> Hi Jeff.... > > So, if he has a formula that depends on the units, I will recommend > that he make a formula, and then he could use an expression like: > > def conv(t): > k = 2. * t.getValue(makeUnit("degF")) > > The only problem with this is that when I invoke the formula in the > Layout Model, the display seems to ignore the "Format" -- I used > "###0.0" but the values displayed are things like > 48.15199999999999.... > > Perhaps there is a better way to approach this? > We create a format jython procedure that formats the value using the format field from the layout model glyph. In the user guide: http://www.unidata.ucar.edu/software/idv/docs/userguide/tools/StationModelEditor.html Look for: >This will result in the calculation of T-TD, a conversion of that result to a >string which is >then concatenated to the string 'TD:'. If you want to format >the result of the numeric >calculation using the format specifier from the >properties dialog simply enter: > >='TD:'+format(T-TD) -Jeff Ticket Details =================== Ticket ID: FEO-270734 Department: Support IDV Priority: Normal Status: Closed