Advertisement
BobMe

ANOTHER THING

Nov 22nd, 2019
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. local molar_mass = 26.04
  2. local number = 20 -- inputs
  3.  
  4. function grab_deci(x)
  5. local k = tostring(x)
  6. local l = ""
  7. for i=1,#k do
  8. if k == "." then
  9. l = string.sub(x,0,i+2)
  10. break
  11. end
  12. end
  13. end
  14. -- convert to moles
  15. local mole_mass = number/molar_mass
  16.  
  17. -- convert liter
  18. local liter_mass = mole_mass * (22.4/1)
  19.  
  20. -- convert molecules
  21. local particle_mass = mole_mass * (6.02*10^23)/1
  22.  
  23. --convert atoms
  24. local atoms = 1.12^24
  25.  
  26. print("Moles: "..mole_mass.."\nLiters: "..liter_mass.."\nParticles: "..particle_mass.."\nAtoms: ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement