﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28213	New template filter like filesizeformat but for other units	Nicolas Bruot	nobody	"File sizes are not the only numbers with a unit that one may encounter when developing an app. **Would it make sense to add a more generic filter that acts on a number similarly to fileformatsize but for other units?**

Rough idea of the behavior of the filter:
  - Takes a number as input (int, float, positive or negative)
  - Finds the most adapted 10^3n^ unit: m (10^-3^), nothing (1), k (10^3^), M (10^6^)...
  - Divides the number by 10^3n^ and localizes it
  - Append the unit

The simplest way to do it may be for the filter to generate strings with just the power prefix like ""123.4 k"", ""-20 m"", and the rest of the unit can then be outside the tag, for example:
{{{
{% 123400|human %}m = 123.4 km (a length)
{% 123400|human %}g = 123.4 kg (a mass)
}}}

However, this strategy makes it difficult for users to fix edge cases they may encounter. Instead, it might be worth to include the whole unit in the tag, in case the power prefix cannot be separated from the unit suffix (or when the suffix also depend on the power):
  - Suffix and prefix may not be separated in some languages (I don't know).
  - Happens for users that prefer full unit string for numbers < 1000, for example ""123 km"", but ""123 meters"" (the same way that filesizeformat uses ""bytes"" instead of ""b"" for a size below 1024).
In such cases, we need to provide a way for the user to specify the unit strings for all the powers (or the other way around: the filter could spit out the power as well as the number, and the user can then work out from that whatever he wants to do)."	New feature	closed	Template system	1.11	Normal	wontfix	Template filter		Unreviewed	0	0	0	0	0	0
