Decimal comma in xml files bug?

41 views
Skip to first unread message

Michael Meyer

unread,
Jul 1, 2020, 1:41:29 AM7/1/20
to weewx-user
Hello, I'm running weewx 4.1.1 on Rpi 3b installed with setup.py.  To get a clean installation I installed buster from scratch.
Before I had installed version 3xxx on the same Rpi with Jessie running.
With a xml.tmpl I grabed the datas to work with them on my smart home system Domoticz.
With the new installation a problem popped up. The xml file have decimal comma instead of decimal points. It's not just my template is also eg. /home/weewx/public_html/rss.xml.
As I read in www decimal point for xml is necessary. My question is it a bug or is there something wrong within my system what I can change.
Any help appreciate
Michael

Tom Keffer

unread,
Jul 1, 2020, 8:15:28 AM7/1/20
to weewx-user
WeeWX formats numbers using Python's locale.format() facility, which typically uses your "default" locale. In your case, that locale must use commas as the decimal separator. 

To change, either change your locale with environment variable LANG to something that uses periods as decimal separators, or override the formatting.

To override the formatting, set option localize to False:

$current.outTemp.format(localize=False)

-tk





--
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 weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/2544a5c5-d34d-426d-b5ad-d544cc5b6792n%40googlegroups.com.

Michael Meyer

unread,
Jul 1, 2020, 9:33:48 AM7/1/20
to weewx-user
Got it thanks.
Reply all
Reply to author
Forward
0 new messages