开发者

Django: how to best implement unit conversion a la Markdown?

开发者 https://www.devze.com 2023-02-07 06:28 出处:网络
Currently building a site on energy efficiency. I have a team of scientists readying articles for our custom Django CMS with lots of numbers and attached units loc开发者_JAVA技巧ated in their contribu

Currently building a site on energy efficiency. I have a team of scientists readying articles for our custom Django CMS with lots of numbers and attached units loc开发者_JAVA技巧ated in their contributions. I would like to offer visitors a way to switch between metric or imperial units.

Discovered the django.contrib.gis.measure module and the Python Markdown module. What do you reckon is the best way to implement unit switching? Develop a Markdown module that provides syntax for marking numbers and the units next to them?

I found this link on Stackoverflow which points out how to convert. The question is how to pick up on the units and then call the conversion?

Thanks for your input!

0

精彩评论

暂无评论...
验证码 换一张
取 消