You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UnityConstruct edited this page Feb 9, 2024
·
1 revision
Lua Methods
dataConverters
bin2dec.lua
---convert a binary represented as string to decimal using specified base--- base would normally be '2' for binary string---@parambinaryStringstring binary number represented as a string---@parambaseinteger base used for conversion---@returninteger .return converted decimal numberfunctionbin2dec(binaryString, base)
returntonumber(binaryString, base)
end---convert a binary represented as string to decimal using base 2---@parambinNumstring binary number represented as a string---@returninteger .return converted decimal numberfunctionbin2dec(binNum)
returnbin2dec(binNum, 2)
end