Jump to content

Template talk:Convert

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
(Redirected from Template talk:Convert/sandbox)
Latest comment: 13 days ago by Indefatigable in topic tenths of a thou
... in conception
... and in reality

Speed in knots

[edit]

How can I add an air or water speed conversion in knots? I tried {{cvt|50|m/s|kmh|knot}}, {{cvt|50|m/s|kmh|knots}}, {{cvt|50|m/s|kmh|kt}}, and {{cvt|50|m/s|kmh|nm/h}}, but all of them generated an error message. - MPF (talk) 18:47, 28 July 2026 (UTC)Reply

Use KN ie 50 kn (95 km/h).Jason Rees (talk) 18:53, 28 July 2026 (UTC)Reply
@Jason Rees, thanks, but I just tried that, and got "Error in convert: Ignored invalid option "kn"" - MPF (talk) 21:12, 28 July 2026 (UTC)Reply
Jason's answer was {{convert|50|kn|km/h|round=5|abbr=on}} which displays as 50 kn (95 km/h) .
The reverse case is: {{convert|100|km/h|kn|0|abbr=on}} which displays as 100 km/h (54 kn) .  Stepho  talk  00:55, 29 July 2026 (UTC)Reply
The output unit is km/h (not kmh) while kn and knot are the same. Multiple output units need to be separated with a space or +. Both these work:
  • {{cvt|50|m/s|km/h knot}} → 50 m/s (180 km/h; 97 kn)
  • {{cvt|50|m/s|km/h+knot}} → 50 m/s (180 km/h; 97 kn)
Johnuniq (talk) 03:10, 29 July 2026 (UTC)Reply
@Johnuniq Super, thanks! - MPF (talk) 12:00, 29 July 2026 (UTC)Reply

Asymmetric uncertainty range

[edit]

It is impossible to convert an asymmetric uncertainty range, e.g. 123+45
−67
, using this template, despite such numbers being extremely common in science. In particular, I want to convert a number in this format from parsecs to light-years. Compare 123 ± 56 feet (37 ± 17 m). –LaundryPizza03 (dc̄) 07:49, 29 July 2026 (UTC)Reply

As it happens, a gigantic discussion now in the archive (Astronomical system of units) led to me putting a bunch of code in the sandbox. Example:
  • {{convert/sandbox|123~123~56|ft|m}} → 123+123
    −56
    feet (37+37
    −17
     m)
Unfortunately, the talented editor wanting the feature has not been active since early March and I don't want to implement something new and complex unless it is significantly used and the results are carefully checked by someone who understands the topic where it is used. Johnuniq (talk) 09:23, 29 July 2026 (UTC)Reply
Indeed, it doesn't currently handle the scientific-notation prefix notation correctly: 123+123
−56
 million feet (37×10^6+37
−17
 m) vs. 123+123
−56
×106 ft
(37+37
−17
×106 m
). Including no e-notation combinable with convert. Implementing this change should give a close-to-deployable beta for uncertainty notation. –LaundryPizza03 (dc̄) 18:00, 29 July 2026 (UTC)Reply
I was hinting at what I would want before releasing this. I would make the change if it was going to be used, and if the person using the new feature was confident they could and would verify a few different cases to confirm that it is working as needed. And check stuff like does it work when used in an article, or does the extra line height muck things up. Regarding "million": with abbr=on the result would use ×106 for both input and output. Currently, abbr=on would show ft instead of feet shown above. If needed, I could easily change unit feet to behave like mile, namely it would always show the full name ("feet" or "foot" if singular). Then e6feet could be used. Johnuniq (talk) 02:26, 30 July 2026 (UTC)Reply
Basically, if this is to be used, the e-notation prefix would need to place a modifier in the correct spot, and a new e= option will be needed for multi-valued convert arguments, such as (3–6)×104 m ((9.8–19.7)×104 ft). –LaundryPizza03 (dc̄) 03:29, 30 July 2026 (UTC)Reply

Template:Convert mu TfD

[edit]

A template for converting Mu (land) units is being discussed at Template:Convert mu TfD. Johnuniq (talk) 08:59, 30 July 2026 (UTC)Reply

Ritual expression of gratitude

[edit]

As a content creator without any technical skill of any kind, I am cosmically obligated to come by here every so often and thank the developers of this template.

the fact that {{convert|80|impgal/min|ml/sec|abbr=on}} exists and works seems like an absolute miracle to me. I love you guys so much for this monument.

This thing is an apotheosis of Wikipedia. THANK YOU jengod (talk) 19:37, 11 August 2026 (UTC)Reply

Thanks, and you’re right that it is a bit of a miracle! Johnuniq (talk) 11:46, 13 August 2026 (UTC)Reply

Input value only

[edit]

Has the ability to display the input value and suppress the unit been added? I saw it suggested back at Template talk:Convert/Archive January 2018#Return part of output: input value only. I'm trying to get 469.02 m.a.A. (1,538.8 ft) but the best I can get is 469.02 m .a.A. (1,538.8 ft) (using {{cvt|469.02|m|ft|adj=mid|.a.A.}}) which gives an odd space. CambridgeBayWeather (#1 deranged), Uqaqatigijaa (talk), Huliva 20:25, 28 August 2026 (UTC)Reply

{{cvt|469.02|m|ft|disp=x|.a.A. (|)}} gives 469.02 m.a.A. (1,538.8 ft) . Be careful of the space in the middle.  Stepho  talk  00:22, 29 August 2026 (UTC)Reply
Excellent. Thank you. CambridgeBayWeather (#1 deranged), Uqaqatigijaa (talk), Huliva 15:07, 29 August 2026 (UTC)Reply

Plural bar or bars

[edit]

Convert currently uses bars as the plural for Bar (unit). Example:

  • {{convert|2|bar|kPa}} → 2 bars (200 kPa)

A recent edit by ~2026-46880-79 at Module:Convert/documentation/conversion data proposes that the plural be bar. Talk:Bar (unit) has a couple of mentions showing that there is disagreement about what is correct (search for "plural"). Should convert say 2 bar or 2 bars? Johnuniq (talk) 03:19, 29 August 2026 (UTC)Reply

As an older Australian, I've always used "bar" as the plural. But not too fussed either way.  Stepho  talk  04:11, 29 August 2026 (UTC)Reply

Disambiguate the unit 'erg'

[edit]

Currently, the unit erg is linked to a disambiguation page, it should be linked to erg (unit). Rob3512 (Talk · C) 04:22, 6 September 2026 (UTC)Reply

Thanks. I have updated the definition and it will be live in the next release. Let me know if that is needed soon because we wait for a few changes before updating. Johnuniq (talk) 06:57, 6 September 2026 (UTC)Reply

an error

[edit]

There is a technical error at the end of the Quick start section. I could not fix it. — Hamid Hassani (talk) 03:36, 9 September 2026 (UTC)Reply

That error was intended to demonstrate what happens if the wrong code is used. It was confusing and perhaps the example could be omitted but I added a note to clarify. Johnuniq (talk) 05:55, 9 September 2026 (UTC)Reply

MGD

[edit]

Apparently this is a standard unit for volumetric flow rate. I think it means 100,000,000 U.S. gal/d (4.4 m3/s) but is there a way to incorporate the "M" for million? — Martin (MSGJ · talk) 09:01, 2 October 2026 (UTC)Reply

Never mind, worked it out! — Martin (MSGJ · talk) 09:10, 2 October 2026 (UTC)Reply
As Pakistan used to use imperial units before to some extent metricating, I'm nervous of assuming it's now using US gallons. NebY (talk) 09:20, 2 October 2026 (UTC)Reply
I don't know anything about MGD but Google confidently points to https://waterunitconverter.com/volumetricflow which claims that 1 MGD = 1.547 cfs = 694.44 gpm = 43.813 L/s. That site uses US gallons.
  • {{convert|1|E6USgal/day|L/s|3}} → 1 million US gallons per day (43.813 L/s)
Johnuniq (talk) 10:11, 2 October 2026 (UTC)Reply

tenths of a thou

[edit]

At Carbon fibers there was a recent change to show "5 to 10 micrometers (2⁄10,000 to 4⁄10,000 of an inch)". I'm not against how it displays to the reader but I can't find a way to use convert. |frac= doesn't seem to work with input units of |μm - just displays 0 . I could use {{convert|5|to(-)|10|μm|thou|sp=us|link=on}} to show 5 to 10 micrometers (0.20–0.39 thou) but thou is still a bit unknown for many readers (even in the US), so I'd like to keep the fraction form. Any clues?  Stepho  talk  23:44, 10 October 2026 (UTC)Reply

Hmmm. Convert can do it but it cleverly reduces the fractions. For example, instead of saying something was 4⁄8 inches, it would say 1⁄2. The following is correct but is not as clean as the original using a tenth thou.
  • {{convert|5|to(-)|10|μm|in|frac=10000|sp=us|link=on}} → 5 to 10 micrometers (1⁄5000–1⁄2500 in)
There is no way to specify that the fractions should not be reduced. Johnuniq (talk) 00:41, 11 October 2026 (UTC)Reply
I happened to find a way to defeat the automatic reduction but it's not quite what anyone would want. 😒
{{convert|5|to(-)|10|μm|thou|sp=us|frac=10000|link=on}} → 5 to 10 micrometers (1969⁄10000–3937⁄10000 thou) NebY (talk) 00:53, 11 October 2026 (UTC)Reply
Thanks guys. I had a typo in my attempts in the article, which is why it didn't work for me. Works now (albeit with reduced fractions and no commas in the fraction).  Stepho  talk  04:35, 12 October 2026 (UTC)Reply
We should remember that the reason for converting measurements is to help people who are more familiar with visualizing the measure in the output units. Are there really any readers who will say, “5 to 10 micrometres? WTF’s that?” and then say, “1⁄5000 to 1⁄2500 inch, OK that’s better, that’s the type of measurement I deal with every day”? I think no conversion is necessary with things like this, as industries working with items this small use micrometres in all countries, even in the US. Indefatigable (talk) 05:00, 12 October 2026 (UTC)Reply