Skip to content

Latest commit

 

History

History
43 lines (27 loc) · 974 Bytes

File metadata and controls

43 lines (27 loc) · 974 Bytes

BaseConverters

A Luau (Roblox) module for converting numbers between decimal, binary, and hexadecimal formats.


Features

  • Convert Decimal to Binary
  • Convert Binary to Decimal
  • Convert Decimal to Hexadecimal
  • Convert Hexadecimal to Decimal

All conversions are done manually without relying solely on built-in functions, making it a great learning tool!


Installation

Simply copy the BaseConverters.lua file into your Roblox project or require it from your preferred location.


Usage

local BaseConverters = require(path.to.BaseConverters)

-- Decimal to Binary
print(BaseConverters.DecimalToBinary(10)) -- Output: "1010"

-- Binary to Decimal
print(BaseConverters.BinaryToDecimal("1010")) -- Output: 10

-- Decimal to Hexadecimal
print(BaseConverters.DecimalToHexadecimal(255)) -- Output: "FF"

-- Hexadecimal to Decimal
print(BaseConverters.HexadecimalToDecimal("FF")) -- Output: 255

Credits

BlocksumoGuys