Template talk:Convert/Archive May 2019

Module version 24
Some changes to the convert modules are in the sandbox, and I intend switching the main modules to use the sandbox soon.

The following examples use fixed wikitext to show the current output from convert/sandbox so it will not change in the future.


 * Change hidden sort key to use data-sort-value
 * The hidden sort key generated by  will change per request here. In addition,   can be used to display the key, rather than.
 * →  7001123400000000000♠ 12.34 m (40.5 ft)
 * →  12.34 m (40.5 ft)
 * which is
 * Avoid using the extra data module
 * Module:Convert/extra is normally empty and what links here should not show any articles using it. However, previous versions of convert have been confused by output units such as  because convert tried   of   before trying the combination of   and  . The result was that the extra module was used to look up  . That will no longer happen although some peculiarities may still occur.
 * → 12.3 thousand acre⋅ft (15.2 million m3; 540 million cu ft)
 * A space after a minus sign is an error
 * Convert has accepted broken input such as  which was in Kedarnath Wildlife Sanctuary. In an effort to require clean wikitext, that will now be an error.
 * → [convert: invalid number ]
 * Input value NNNN will consistently give no output
 * Some infoboxes offer wikitext such as  where it is understood that   needs to be replaced with a number. Also, some editors put converts with no value into an article in the hope that the value will be inserted later. Errors in articles clutter the error tracking category so convert supports   (three or more  ) as an input value which means "value is intentionally missing; show no output". Some options still gave an error. While the options are unlikely to be used, convert has been fixed to always output nothing.
 * Wikidata labels updated
 * Module:Convert/wikidata/data/sandbox lists units defined at Wikidata and which can be used in convert (for infoboxes). Some labels have been updated to match changes on Wikidata. Three unimportant inconsistencies remain as shown at Module talk:Convert/wikidata/data/sandbox. The labels are only a convenience and are not used by convert.
 * Wikidata labels updated
 * Module:Convert/wikidata/data/sandbox lists units defined at Wikidata and which can be used in convert (for infoboxes). Some labels have been updated to match changes on Wikidata. Three unimportant inconsistencies remain as shown at Module talk:Convert/wikidata/data/sandbox. The labels are only a convenience and are not used by convert.

Release notes for earlier versions are listed here. Johnuniq (talk) 02:42, 2 May 2019 (UTC)
 * Done, this version is now live. @Huntster: Per our previous discussion, you might like to know that output units like  now have no problems and   is not needed. Johnuniq (talk) 03:52, 4 May 2019 (UTC)
 * <3 — Huntster (t @ c) 04:06, 4 May 2019 (UTC)

Default to Sortable=on?
I can't think of any reason why you'd want converted numbers sorted alphabetically instead of numerically; why is sortable=on not the default? I just had to make this edit to make the tables sort correctly which should seem to be necessary. Reywas92Talk 18:32, 16 May 2019 (UTC)
 * on generates HTML code that's only needed in tables. For instance, here's the output of from Special:ExpandTemplates. — Eru·tuon 19:45, 16 May 2019 (UTC)
 * Defaulting to sortable=on would add too much bloat to the HTML output. I know it's unfashionable to be concerned about efficiency but a very large number of converts have no need of a hidden sort key. A section above has some examples of the output. Johnuniq (talk) 23:23, 16 May 2019 (UTC)

U.S. Cup as unit?
I'd be interested in seeing the (U.S. customary) Cup (unit) as a unit - I have been adding convert templates to some culinary pages and I'm puzzled why we have US quart but not US cup. The archives only mention the cup as a convertible unit once (Template talk:Convert/Archive May 2009), but as this discussion was a decade ago, I think the "there's too many different types of cups" argument is inadequate. We already have a swathe of separate imperial and US customary units in Module:Convert/documentation/conversion_data (including gallon, pint, quart, kenning, and gill), so I'd feel the "too many supported units" ship has long since sailed.-Ich (talk) 11:25, 20 May 2019 (UTC)
 * @Ich: I hope you don't mind but I moved your comment from Module talk:Convert to here because this is the page to discuss units. I will think about the issue later. Johnuniq (talk) 11:32, 20 May 2019 (UTC)
 * Thanks - I actually had meant to put it on the template talk page.-Ich (talk) 12:09, 20 May 2019 (UTC)
 * There is no standard cup. Recipe books used cups for measuring flour, sugar, raisins etc. because not everybody had weighing scales, but pretty much everybody had a cup of some sort. Although the relative proportions of the ingredients were important, the exact amounts were not critical. -- Red rose64 &#x1f339; (talk) 20:49, 20 May 2019 (UTC)
 * That was back in the day. Most people nowadays use a plastic measuring cup. A cup is defined as 250 ml. The US cup is smaller. See Cup (unit).  Hawkeye7   (discuss)  21:00, 20 May 2019 (UTC)
 * Half a pint in the US and the UK, but then the pint differs! Specifically a US cup is 8 oz and a UK cup 10 oz.  These measures are marked on measuring jugs and similar. Martin of Sheffield (talk) 21:15, 20 May 2019 (UTC)
 * Cup (unit) mentions various official cups of 100 mL, 120 mL, 123 mL, 150 mL, 180 mL, 200 mL, 227 mL, 240 mL, 246 mL, 250 mL and half an imperial pint. Which is the official WP cup that doesn't conflict with various national standards? Or are we going to have separate unit names for each of the above?  Stepho  talk 22:30, 20 May 2019 (UTC)
 * We have separate units for Imperial and US pints and gallons, I'd be interested in seeing units for "U.S. legal cup" (240 ml, 8 rounded fluid oz., used for food labeling and baking) and "metric cup" (250 ml, used in metric countries), and "U.S. customary cup" (236 ml, i.e. 8 unrounded US fluid oz). Cup (unit) notes that "imperial cup" (284 ml) and "Canadian cup" (227 ml) are either deprecated or rarely used; the Latin American cups are poorly-defined; according to Obsolete Russian units of measurement, Russian cups were phased out in 1925 (and "cup" doesn't appear on that page either). The Japanese cup (180 ml) could have its own unit if someone wants it. So that's "only" three cups. And now that I'm reading it - the "fluid oz. for food" isn't included in convert templates, so if we only had the 236-ml cup, we could generally compensate for the lack of the 240-ml cup with rounding in the template, rather than needing the third unit.-Ich (talk) 10:39, 21 May 2019 (UTC)
 * There is no practical difference between 240 ml and 236 ml: does anyone fill a cup with the accuracy required so that would matter? Sorry to be difficult but there are a lot of unused units and it is traditional here to only accept new units which have an immediate need. That is, in what article (preferably more than one) would the unit be used, and for what text? Johnuniq (talk) 10:51, 21 May 2019 (UTC)

{@|Ich}}, you forgot to list the coffee cup - 120 mL in the US and 150 mL in Commonwealth countries (not sure which one Canada uses). The article seems to imply that US coffee makers can use either 120 or 150 mL. That brings the list back up to 5. You allowed for the modern Japanese cup of 200 mL but the traditional cup of 180 mL is still used for rice and sake. I will carefully measure my 2 Japanese rice cookers in the next few days to test this.  Stepho  talk 22:58, 21 May 2019 (UTC)
 * No one is disputing that cups are made in different sizes. What is being discussed here the the cooks' measure of "a cup of flour" etc.  That is half a pint (whatever the local pint is) or else some metric creation needed to retain a practical unit. I'm sure the SI don't approve of cups, so the metric versions can and should be ignored as "standard".  That just leaves us with the US and the Imperial sizes, 8 floz and 10 floz respectively.  However, I think the key phrase from the discussion above is Johnuniq's comment that "it is traditional here to only accept new units which have an immediate need", so let's all just wait untill a need can be demonstrated. Martin of Sheffield (talk) 08:07, 22 May 2019 (UTC)

Electric car efficiency
I was trying to convert 26 kWh/100 miles to 16 kWh/100 km. The closest I could get is 26 kWh/mi to give 26 kWh/mi. I can also use kWh/100km but the kWh/100miles is eluding me.  Stepho  talk 07:31, 25 May 2019 (UTC)
 * Assuming that is a unit used by reliable sources, I added  to Module:Convert/extra so it can be trialed. Presumably you are sure sources don't use kWh/mi?
 * → 26 kWh/100mi
 * → 26 kWh/100mi
 * Johnuniq (talk) 09:22, 25 May 2019 (UTC)
 * US-specific "Monroney" statements use File:Smart_ED_Monroney_sticker_WAS_2011_1126.jpg and Miles per gallon gasoline equivalent (MPGeEPA).  —Sladen (talk) 09:40, 25 May 2019 (UTC)
 * Thanks, your links show that kWh/100mi is a well-established unit. I'm still mpg. Johnuniq (talk) 10:34, 25 May 2019 (UTC)
 * Thanks, that looks like it will do the job. Can I use in articles or is it still provisional?
 * And I feel like I'm being ungrateful, but is there a way to abbreviate "kWh" but spell out "miles" in full ('mi' always looked wrong to me, even though I know about 'm' being ambiguous with metres). Either way, I'm grateful for your help.  Stepho  talk 12:55, 25 May 2019 (UTC)

I agree it looks bad so I added  as an alternative. Both can be used now. In a few weeks the units will be changed to "permanent" status provided they are used in a couple of articles. Please check the above. Johnuniq (talk) 04:09, 26 May 2019 (UTC)
 * → 1 kWh/100mi
 * → 2 kWh/100mi
 * → 1 kWh/100miles
 * → 2 kWh/100miles
 * → 1 kWh/100mi
 * → 2 kWh/100mi
 * → 1 kWh/100miles
 * → 2 kWh/100miles
 * → 1 kWh/100km
 * → 2 kWh/100km
 * → 1 kWh/100km
 * → 2 kWh/100km
 * → 1 kWh/100km
 * → 2 kWh/100km
 * → 1 kWh/100km
 * → 2 kWh/100km


 * Thank you very much, that works beautifully. I used kWh/100miles at Tesla Model 3 and kg/100miles at Toyota Mirai.  Stepho  talk 11:55, 27 May 2019 (UTC)