Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 PHP 中将 Decimal (52.44554) 转换为 DDD MM.MMM?
标准步骤是:
52 = N52° + 0.44554*60 => 26,732; ===> N52° 26,732
这应该这样做。 $degrees并且$minutes会保存你感兴趣的值。
$degrees
$minutes
$dec_degrees = 52.44554; $degrees = floor($dec_degrees); $dec_minutes = $dec_degrees - $degrees; $minutes = 60 * $dec_minutes;