Advertisement
RuiViana

Float to digito

Jul 21st, 2015
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include <htc.h>
  2. int DD0;
  3. int DD1;
  4. int DD2;
  5. int DD3;
  6.  
  7. void main(void)
  8. {
  9. float test = 00.75;
  10. long value ;
  11. value = (long)(test*100);
  12.  
  13. DD0 = ((value/1000)%10);
  14. DD1 = ((value/100)%10);
  15. DD2 = ((value/10)%10);
  16. DD3 = ((value/1)%10);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement