Jump to content

Template talk:Convert: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
m Archiving 2 discussion(s) to Template talk:Convert/Archive July 2018) (bot
DocFergus (talk | contribs)
Line 35: Line 35:
== Nomination for deletion of Template:Miles ==
== Nomination for deletion of Template:Miles ==
[[File:Ambox warning blue.svg|30px|link=]][[Template:Miles]] has been [[Wikipedia:Templates for discussion|nominated for deletion]]. You are invited to comment on the discussion at [[Wikipedia:Templates for discussion/Log/2018 September 2#Template:Miles|the template's entry on the Templates for discussion page]].<!--Template:Tfdnotice--> [[User:Frietjes|Frietjes]] ([[User talk:Frietjes|talk]]) 15:32, 3 September 2018 (UTC)
[[File:Ambox warning blue.svg|30px|link=]][[Template:Miles]] has been [[Wikipedia:Templates for discussion|nominated for deletion]]. You are invited to comment on the discussion at [[Wikipedia:Templates for discussion/Log/2018 September 2#Template:Miles|the template's entry on the Templates for discussion page]].<!--Template:Tfdnotice--> [[User:Frietjes|Frietjes]] ([[User talk:Frietjes|talk]]) 15:32, 3 September 2018 (UTC)

== Template does not always convert tonnes to imperial units. ==

Using the Convert template to convert between 1100 and 3100 (metric) tonnes (inclusive) to imperial units returns an incorrect answer as in:

:{{xt|{{convert|1099|t|LT}}}}
:{{!xt|{{convert|1100|t|LT}}}} (Should be 1083)
:{{!xt|{{convert|3100|t|LT}}}} (Should be 3051)
:{{xt|{{convert|3101|t|LT}}}}
and if converting imperial pounds

:{{xt|{{convert|1099|t|lb}}}}
:{{!xt|{{convert|1100|t|lb}}}} (Should be 2,425,000)
:{{!xt|{{convert|3100|t|lb}}}} (Should be 6,834,000)
:{{xt|{{convert|3101|t|lb}}}}

This hold true for conversion of metric tonnes to any imperial unit of mass including ounces, stones, troy ounces and troy pounds. Something screwy is going on because converting metric tonnes to long tons gives results that are too large whereas converting to pounds gives answers that are too small. It works with non imperial units correctly and also correctly when converting from imperial units to other units.:

:{{xt|{{convert|1099|t|ST}}}}
:{{xt|{{convert|1100|t|ST}}}}
:{{xt|{{convert|3100|t|ST}}}}
:{{xt|{{convert|3101|t|ST}}}}

[[User:DocFergus|DocFergus]] ([[User talk:DocFergus|talk]]) 16:48, 12 September 2018 (UTC)

Revision as of 16:48, 12 September 2018

Rendering of foot/inch with adjectives

I want to convert 18.3 ft as a height measure to render with a foot-inch measurement as an adjective of height, like this:

18-foot-4-inch height (5.6 m).

Instead, when I try {{convert|18.3|ft|ftin m|adj=mid|height|order=out}}., the noun is missing:

18-foot-4-inch (5.6 m).

If I change ftin to a more conventional decimal-based measure like in or yd, the noun appears as expected:

6.1-yard height (5.6 m).

So there must be a rendering bug when using those odd combo-units with adjectives. — Preceding unsigned comment added by D271l (talkcontribs) 19:24, 6 August 2018 (UTC)[reply]

There is nothing wrong (see WP:CALC) with mentally converting 18.3 ft to 18 ft 4 in given the precisions involved, so the following might do:
  • {{convert|18|ft|4|in|m|1|adj=mid|-height}} → 18-foot-4-inch-height (5.6 m)
Or omit the hyphen from "-height" if that would be better in context. That is strange about order=out causing "height" to be ignored but I don't have time to think about that now. I will look soon. Johnuniq (talk) 23:23, 6 August 2018 (UTC)[reply]
Looks like {{Convert}} is consistent: by setting |order=out you are requesting to omit the first, fully adjectivated+midword value of the three. Then, "By default, the first quantity shows unit name" so ftin are written by name not abbreviation:
{{convert|18.3|ft|ftin m|adj=mid|height}} → 18.3-foot height (18 ft 4 in; 5.6 m)
{{convert|18.3|ft|ftin m|adj=mid|height|order=out}} → 18-foot-4-inch (5.6 m)
-DePiep (talk) 03:02, 7 August 2018 (UTC)[reply]

Nomination for deletion of Template:Miles

Template:Miles has been nominated for deletion. You are invited to comment on the discussion at the template's entry on the Templates for discussion page. Frietjes (talk) 15:32, 3 September 2018 (UTC)[reply]

Template does not always convert tonnes to imperial units.

Using the Convert template to convert between 1100 and 3100 (metric) tonnes (inclusive) to imperial units returns an incorrect answer as in:

1,099 tonnes (1,082 long tons)
1,100 tonnes (1,100 long tons) (Should be 1083)
3,100 tonnes (3,100 long tons) (Should be 3051)
3,101 tonnes (3,052 long tons)

and if converting imperial pounds

1,099 tonnes (2,423,000 lb)
1,100 tonnes (2,400,000 lb) (Should be 2,425,000)
3,100 tonnes (6,800,000 lb) (Should be 6,834,000)
3,101 tonnes (6,837,000 lb)

This hold true for conversion of metric tonnes to any imperial unit of mass including ounces, stones, troy ounces and troy pounds. Something screwy is going on because converting metric tonnes to long tons gives results that are too large whereas converting to pounds gives answers that are too small. It works with non imperial units correctly and also correctly when converting from imperial units to other units.:

1,099 tonnes (1,211 short tons)
1,100 tonnes (1,200 short tons)
3,100 tonnes (3,400 short tons)
3,101 tonnes (3,418 short tons)

DocFergus (talk) 16:48, 12 September 2018 (UTC)[reply]