Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local molar_mass = 26.04
- local number = 20 -- inputs
- function grab_deci(x)
- local k = tostring(x)
- local l = ""
- for i=1,#k do
- if k == "." then
- l = string.sub(x,0,i+2)
- break
- end
- end
- end
- -- convert to moles
- local mole_mass = number/molar_mass
- -- convert liter
- local liter_mass = mole_mass * (22.4/1)
- -- convert molecules
- local particle_mass = mole_mass * (6.02*10^23)/1
- --convert atoms
- local atoms = 1.12^24
- print("Moles: "..mole_mass.."\nLiters: "..liter_mass.."\nParticles: "..particle_mass.."\nAtoms: ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement