మాడ్యూల్:Infobox road/length: కూర్పుల మధ్య తేడాలు
Content deleted Content added
Disproportionate fix for the relatively minor problem of trailing zeros |
Rschen7754 (చర్చ | రచనలు) emergency revert |
||
పంక్తి 1:
local p = {}
local math = require "Module:Math"▼
local function getLengths(args, num)
▲ local math = require "Module:Math"
local precision = math._precision
local round = math._round
local lengths = {}
local km = args["length_km" .. num] or ''
local mi = args["length_mi" .. num] or ''
if '' == km then
local n = tonumber(mi)
local prec =
if n then
else
lengths.km =
end
else
lengths.orig = "km"
lengths.comp = "mi"
Line 29 ⟶ 23:
if '' == mi then
local n = tonumber(km)
local prec =
if n then
else
lengths.mi =
end
else
lengths.orig = "mi"
lengths.comp = "km"
Line 50 ⟶ 41:
local notes = args["length_notes" .. num] or ''
local lengths = getLengths(args, num)
local lang = mw.getContentLanguage()
local first, second
if lengths.orig == "mi" then
first = lang:formatNum(lengths.mi)
second = lang:formatNum(lengths.km)
else
first = lang:formatNum(lengths.km)
second = lang:formatNum(lengths.mi)
end
if first == '0' and second == '0' then
|