Template talk:Mile

From Wikivoyage
Jump to navigation Jump to search

Rounding[edit]

"{{mile|100}}" produces 100 mi (160 km), however since 100 miles is 160.9 miles, shouldn't it round to 161 miles? —The preceding comment was added by 82.3.185.12 (talkcontribs)

That's strange. I'll take a look into the code today. SHB2000 (talk | contribs | en.wikipedia) 21:36, 14 May 2021 (UTC)[reply]
@SHB2000: Maybe it rounds to the nearest 5 or 10 miles? 82.3.185.12 19:10, 15 May 2021 (UTC)[reply]
243 mi (391 km) is in exact form. SHB2000 (talk | contribs | en.wikipedia) 23:08, 15 May 2021 (UTC)[reply]
@SHB2000: It could be becausee 100 miles is less than 161 miles (even though it is 160.9) it says 160, and since 243 miles is more than 391 miles, it shows that. I think instead of rounding the number, it ignores the decimal places and shows the whole number, even if it is not the nearest one. 82.3.185.12 16:57, 17 May 2021 (UTC)[reply]
Possibly. SHB2000 (talk | contribs | en.wikipedia) 07:57, 18 May 2021 (UTC)[reply]