Advertisement
Guest User

batch decimal calculator failed attempt

a guest
May 27th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. set /p cost=-
  2. cls
  3. if %cost%==0 set "cost=nul"
  4.  
  5. set /a est=%hours%*%pph%
  6.  
  7. REM Sorting cents
  8. set /a estcent=%hours%*%pphc%
  9. set /a estcentf=%estcent%/10
  10. cls
  11.  
  12. REM Sorting net earn
  13.  
  14. set centofcost=%cost:~-2%
  15. REM gets all but the last 2 (the cents) of the cost
  16. set allbutlast2=%cost:~0,-2%
  17.  
  18. if NOT %cost%==nul set /a net=%est%-%allbutlast2%
  19. if NOT %cost%==nul set /a centofnet=%estcentf%-%centofcost%
  20.  
  21. REM if i spent nothing on food and drink, set the net to what i normally earn
  22. if %cost%==nul set "net=%est%.%estcentf%"
  23. if %cost%==nul set cost=0
  24.  
  25. if not exist %loc% MD %loc%
  26. set date3=%date:~0,-10%
  27. if %date3%==MON set "break=echo.^ "
  28.  
  29. ::======
  30. ::test shit
  31. ::======
  32.  
  33.  
  34.  
  35. ::==The other thing | dont touch this. not needed
  36. set fullpay=%est%.%estcentf%
  37. ::==
  38.  
  39. set "cotn=%centofthenet%"
  40. set "netvar=%net%"
  41.  
  42. ::==if the cent of netpay is below 0, add 100 and minus 1 from dollar of net pay
  43. ::if %cotn%==LEQ 1 (
  44. ::set /a centofnet=%cotn%+100
  45. ::set /a net=%netvar%-1
  46. ::)
  47.  
  48. ::== How much I earned after taking off what I spent on food
  49. set "netpay=%net%.%centofnet%"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement