https://bugzilla.wikimedia.org/show_bug.cgi?id=235

--- Comment #37 from Happy-melon <[email protected]> 2011-03-24 
15:32:48 UTC ---
This is a feature of the system, not a bug, it is parsing the precision of the
input as well as its value.  The precision of "69" is 0.5/69 = 0.72%; the
precision of the output is constructed to be as similar as possible; in this
case 0.45%.  110 would have a precision of 5/110 = 4.5%, 111.0 would have a
precision of 0.045%  In this case "70" is correctly interpreted to have a
precision of 5/70 = 7.1%, so it selects 110 as the correct precision for the
output to match as closely as possible.

The mistake in your logic is to be considering your input as an exact value,
but to expect the output to be imprecise to an arbitrary level of accuracy. 
The exact value of precisely 70 miles (70.00000 miles) in km is 112.65408, but
that's neither the value you put in nor the answer you expected out.  The
template is not psychic, it cannot know what precision you (consciously or
subconsciously) expected out unless you tell it; its default position is to
retain the same precision in the input as in the output.

If you want to ensure that the appropriate precision is used, you can specify
it; I can't remember how offhand in the {{convert}} template; maybe
{{convert|...|dp=0}} for zero decimal places, or somesuch.  Or you can be more
clever with the input value; in the {{#convert:...}} parser function you can
specify {{#convert: 7.0E1 km | mi }} to ensure that the number is treated with
the right level of precision.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to