Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- AAAAAAAAAAAAAAA
- --[[function afterdeci(x)
- local k = tostring(x)
- for i=1,#k do
- if string.sub(k,i,i) == "." then
- return string.sub(k,i+1,i+)
- end
- end
- end]]
- function round(x,roundto)
- local k = tostring(x)
- local num
- local dot = 0
- for i=1,#k do
- if string.sub(k,i,i) == "." and dot == 0 then
- dot = i
- elseif dot ~= 0 then
- num = string.sub(k,1,dot+roundto)
- break
- end
- end
- return tonumber(num)
- end
- local molar_mass = 58.442407
- local value = 26.32
- local atoms = 2
- local moleingram = value*(1/molar_mass)
- print("Moles in gram: "..round(moleingram,2))
- local molestoliter = moleingram*22.4
- print("Gram moles to liter: "..round(molestoliter,2))
- local molecules = moleingram * (6.02*10^23)
- print("Gram moles to "..round(molecules,2))
- local molecules2 = molecules * atoms
- print(molecules2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement