How to bypass Scientific Notation and turn it into a integer without losing the exact value / rounded

Alright, so I know there have been many many posts on this, but most are outdated and use :LoadLibrary() like BigNum for example but that function is now depreciated, I tried using Rostrap, both offline and online but both don’t work for some reason. So, I was wondering is there any other way to pass this? But first let me explain what I am doing,

I am trying to make a script that kicks said user from both the Roblox game and Discord server linked with it. The command is executed from Roblox. I do this by getting the Users Discord ID through a verification process, which I won’t bore you with. But in short, I store the Discord ID in a IntValue which I stored inside a folder inside each LocalPlayer. This works perfectly fine, the only issue with this is, when I try to kick the user from the discord, it doesn’t work and the number is converted into scientific notation. Here’s what I mean:

if string.sub(message:lower(), 1, 6) == "!gkick" then
				local foundplayer = string.sub(message:lower(), 8)
				
				local plrtokick = getPlayer(foundplayer)
				
				if plrtokick ~= nil then
					plrtokick:Kick("Kicked from both Discord and Roblox")
					
					local id = plrtokick.Stats.DiscordID
	
						print(id.Value)
						local response = http:RequestAsync(
						{
								Url = "https://discord.com/api/v9/guilds/850047178973511730/members/"..id.Value,
								Method = "DELETE",
								Headers = {
									authorization = "TOKEN"
							},
							print("Workety worked")
						}
					)
				end
				
			end

The value is returned as a scientific notation. So I as wondering, is there any way around this feature?

What do you mean by “turning it to integers without rounded”? All numbers in Luau are represented in the IEEE 754 double precision floating point format and therefore there’s no native integer data type. so you cannot “turn it into integers”.

If you need to format where the double internally gets converted to signed 64-bit integer. You could use string.format with %d specifier. You can “bypass” scientific notation this way.

string.format("%d", id.Value)
1 Like

This doesn’t work, when I try to print the value of it, the number is off from the original number.

This has been fixed by simply switching over to a StringValue.