Formatting value in HTML-Template

Discussion of the Meteohub software package

Moderator: Mattk

wfpost
Platinum Boarder
Platinum Boarder
Posts: 591
Joined: Thu Jun 12, 2008 2:24 pm
Location: HONSOLGEN
Contact:

Re: Formatting value in HTML-Template

Post by wfpost »

i´m using it long time with wind, working !
could it be that the missing spaces with your example are a problem?

{precision 0 [last15m_wind0_speedmax_kmh:-]} km/h - <a class="velwind" href="#vel"><img src="wind.png" align=left border="0" title="rechts gemittelte Windmesswerte der jeweils letzten 15 Minuten" / ><span><img src="http://adr.homedns.org:85/meteograph.cgi?graph=48wind" /><br />wind velocity - vitesse du vent - velocidad del viento - <font color="red">B&ouml;e<sub>max</sub>: {precision 0 [day1_wind0_gustspeedmax_kmh]} km/h</font> &bull; <font face="serif" color="blue" size="2" weight="600">([day1_wind0_gustspeedmax_time#IJ]:[day1_wind0_gustspeedmax_time#KL] Uhr)</font></span></a> [last15m_wind0_maindir_de:-] <br> {precision 0 [last15m_wind0_speedmax_bft:-]} Bf &bull;
wfpost
Platinum Boarder
Platinum Boarder
Posts: 591
Joined: Thu Jun 12, 2008 2:24 pm
Location: HONSOLGEN
Contact:

Re: Formatting value in HTML-Template

Post by wfpost »

yep, it´s the missing space, as you can see here.

used your html, but sticked to Boris syntax written down in the manual

{precision 0[last60m_th0_hummin_rel:0]} -- wrong
{precision 0 [last60m_th0_hummin_rel:0]} -- working

http://adr.homedns.org:85/meteohtml.cgi?file=testupload
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Meteohub HTML Mini-Dashboard</title>
</head>

<body bgcolor="#ffffff">
<table border="1" cellpadding="0" cellspacing="2" width="200">
<tr>
<td>{precision 0 [last60m_th0_hummin_rel:0]}</td>
</tr>
<tr>

<td>{precision 0 [last60m_th0_hummax_rel]}</td>
</tr>

</table>
<p></p>
</body>

</html>
Last edited by wfpost on Sat Apr 14, 2012 8:07 pm, edited 2 times in total.
aco186
Fresh Boarder
Fresh Boarder
Posts: 12
Joined: Fri Mar 02, 2012 5:04 pm
Location: Ljubljana
Contact:

Re: Formatting value in HTML-Template

Post by aco186 »

You are right! There must be a space between "0" and "[". Thanks!
What are the signs at the and of funcrion, before "}" (:- :0)?
wfpost
Platinum Boarder
Platinum Boarder
Posts: 591
Joined: Thu Jun 12, 2008 2:24 pm
Location: HONSOLGEN
Contact:

Re: Formatting value in HTML-Template

Post by wfpost »

:-
is used to print in a simple dash just in case the sensor value does not exist for whatever reason.
With that you will then only see a
-
instead of the whole variable name.

you could also write
:failure
:sensor failure
or whatever you want to avoid the long variable name to stamped in because of missing values
aco186
Fresh Boarder
Fresh Boarder
Posts: 12
Joined: Fri Mar 02, 2012 5:04 pm
Location: Ljubljana
Contact:

Re: Formatting value in HTML-Template

Post by aco186 »

Thanks again. :D
Post Reply