Unless you assign your new types lakeElevation and lakeWaveheight to a unit
group, they will be unknown to WeeWX, so it doesn't know how to format
them. In that case, their unformatted, raw value will be used. You can
either assign them to a unit group, or format them explicitly.

The instructions for how to assign a unit group
<http://weewx.com/docs/customizing.htm#Assigning_a_unit_group> are in the
documentation, but here's the short version. For wave height and lake
elevation, the two existing groups, group_length and group_altitude,
respectively, would be appropriate. Add this to user/extensions.py:

import weewx.units
weewx.units.obs_group_dict['lakeWaveheight'] = 'group_length'
weewx.units.obs_group_dict['lakeElevation'] = 'group_altitude'

Alternatively, if you just want to supply explicit formatting, do this:

<td class="data">$current.lakeElevation.format("%.2f")</td>
<td class="data">$current.lakeWaveheight.format("%.1f")</td>

-tk


On Wed, Feb 27, 2019 at 3:00 PM Messy Potamia <[email protected]>
wrote:

> Need these to format to %.2f or %.1f and I can't find where it does it.
> This is a snipped capture of output of my current.inc:
>
> [image: LakeData_Current.jpg]
> #if $day.lakeElevation.has_data
>       <tr>
>         <td class="label">$obs.label.lakeElevation</td>
>         <td class="data">$current.lakeElevation</td>
>       </tr>
> #end if
>
> #if $day.lakeWaveheight.has_data
>       <tr>
>         <td class="label">$obs.label.lakeWaveheight</td>
>         <td class="data">$current.lakeWaveheight</td>
>       </tr>
> #end if
>
>
> I need for LakeElevation and lakeWaveheight to %.2f and %.1f.
>
> These two are the images created, the y axis fmt is correct on them.
>
>
> Where do I override a format on a specific instance?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to