Jump to content
McKay Development

Converting chat messages string to an integer.


Recommended Posts

Posted (edited)

Hello, I've been working on a function on my bot that requires the user to insert different user's steamID64 (through chat message).

The problem is I need this to be an integer.

I already tried parseInt(), parseFloat() & Math. Functions, but for some reason this changes last 2 numbers of the ID to 20. (I also tried adjusting the base values (parseInt(msg[1], 10))

 

Any help would be appreciated!

Edited by TomYoki
Posted

JavaScript does not have integers. It only has double-precision floating-point numbers, which can only safely represent integers up to 2^53 - 1. Consequently, you can't have a SteamID as an integer, only as a string.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...