Guest User

Untitled

a guest
Jul 15th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. int hours = (int)hoursDecimal;
  2. decimal minutesDecimal = ((hoursDecimal - hours) * 60);
  3. int minutes = (int)minutesDecimal;
  4. int seconds = (int)((minutesDecimal - minutes) * 60);
  5.  
  6. trunc(mod(dec, 1)) => hours
  7. trunc(mod(dec * 60, 60)) => minutes
  8. trunc(mod(dec * 3600, 60)) => seconds
  9.  
  10. int seconds = (int) ((dec * 3600) % 60)
Add Comment
Please, Sign In to add comment