# Discourse Units - Convert durations, lengths and masses

**URL:** <https://meta.discourse.org/t/discourse-units-convert-durations-lengths-and-masses/149360>\
**Category:** Theme component\
**Created:** [July 30, 2020, 11:01am UTC](https://meta.discourse.org/t/discourse-units-convert-durations-lengths-and-masses/149360 "2020-07-30T11:01:16Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)\
**Post date:** [August 12, 2020, 9:13am UTC](https://meta.discourse.org/t/discourse-units-convert-durations-lengths-and-masses/149360/4 "2020-08-12T09:13:37Z")

</div>

> [@dan](#):
>
> I remember this being a bit tricky. I did not check for the “unit” to be a whole word because I wanted to avoid defining all forms (singular and plural) of measurement units ( `min` , `minute` , `mins` , `minutes` ). I will have to do it.

Hi @dan

Might be a good idea (1) not to convert or display your conversion for any number which does not have units behind it; and (2) to have a white list of acceptable units and only convert those; to save you from having an intractable problem.

HTH

---

_[View the full topic](https://meta.discourse.org/t/discourse-units-convert-durations-lengths-and-masses/149360)._
