Module:Coordinates: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
No edit summary
No edit summary
Line 247: Line 247:
-- {{#expr:{{{1}}} mod 360}}°{{padleft:{{#expr:({{{1}}} * 600 round 0) mod 600 / 10 round 0}}|2|0}}′
-- {{#expr:{{{1}}} mod 360}}°{{padleft:{{#expr:({{{1}}} * 600 round 0) mod 600 / 10 round 0}}|2|0}}′
local d = math.floor(coordinate % 360) .."°"
local d = math.floor(coordinate % 360) .."°"
local m = string.format( "%02d′", math_mod._round( math_mod._round(coordinate * 600, 0) % 600 / 10, 0 ) )
local m = string.format( "%02d′", math_mod._round( math_mod._round(coordinate * 60, 0) % 60, 0 ) )
return d .. m
return d .. m
Line 255: Line 255:
--{{#expr:(((({{{1|0}}}) * 3600) round 0) / 3600) mod 360}}°{{padleft:{{#expr:(((3600 * ({{{1|0}}})) round 0) / 60) mod 60}}|2|0}}′{{padleft:{{#expr:((360000 * ({{{1|0}}})) round -2) mod 6000 div 100}}|2|0}}″
--{{#expr:(((({{{1|0}}}) * 3600) round 0) / 3600) mod 360}}°{{padleft:{{#expr:(((3600 * ({{{1|0}}})) round 0) / 60) mod 60}}|2|0}}′{{padleft:{{#expr:((360000 * ({{{1|0}}})) round -2) mod 6000 div 100}}|2|0}}″
local d = math.floor(coordinate % 360) .. "°"
local d = math.floor(coordinate % 360) .. "°"
local m = string.format( "%02d′", math.floor(60 * coordinate) % 60 )
local m = string.format( "%02d′", math_mod._round( 60 * coordinate, 0 ) % 60 )
local s = string.format( "%02d″", (math_mod._round( 360000 * coordinate, -2 ) % 6000) / 100 )
local s = string.format( "%02d″", (math_mod._round( 360000 * coordinate, -2 ) % 6000) / 100 )