Nikola Smolenski wrote:
On Tuesday 23 March 2004 10:16, David Gerard wrote:
On 03/23/04 05:59, Nikola Smolenski wrote:
It is possible to change the software in such a way that, for example, {{num:km2:357022}} would render as 357,022 km<sup>2</sup> for users and visitors from Europe and as whichever mi<sup>2</sup> for users and visitors from the US.
This is not a good idea. It will lead to silly pseudo-accuracy, of the sort often seen in sloppy journalism: where "a thousand miles" in a US wire report is carefully translated to "1.609 km" in an Australian newspaper article.
Well, I doubt that this could be a problem. If the exact number is unimportant, the {{num:}} would simply not be used. If someone uses it wrongly, someone else would revert. Finally, there could be workaround for this, for example, {{num:~mi:1000}} might get out as "1600 km" (converted, then rounded to a precision of, say, original number/10).
A better idea IMHO would be to guess the number of significant figures in the original number and to convert it to another number with the same accuracy. I saw in New Scientist recently "up to 3000 K (2737 C)", I have to say it annoys the hell out of me.
A possible algorithm would be that in a number with rightmost zeros left of the decimal point, or in a number with one significant figure, use one extra significant figure. In a number with no rightmost zeroes left of the decimal point but more than 1 sig fig, use the same number of significant figures. Finally, if the result is more than 20% different to the true value, extra digits are added to bring it to the appropriate accuracy.
So 3000 K becomes 2700 K due to the extra sig fig, 1 K becomes -273 C due to the 20% rule, 1.0 miles becomes 1.6 km, 1.000 miles becomes 1.609 km.
-- Tim Starling.