I have a decimal value say 123.77
Now i want to convert it into corresponding degree
, minute
, second
value using MySQ
Here's how,
Query,
SET @deci = 123.77;
SELECT FLOOR(@deci) Degrees,
FLOOR((@deci - (FLOOR(@deci))) * 60) Minutes,
((@deci - (FLOOR(@deci))) * 60 -
FLOOR((@deci - (FLOOR(@deci))) * 60)) * 60 SECONDS
SQLFIDDLE DEMO
Online Conversion Tool (for checking)