Skip to content

Add StringToInt64() and Int64ToString() natives - #1511

Merged
asherkin merged 4 commits into
alliedmodders:masterfrom
Wend4r:patch-3
Jun 28, 2021
Merged

asherkin merged 4 commits into
alliedmodders:masterfrom
Wend4r:patch-3

Conversation

@Wend4r

@Wend4r Wend4r commented Jun 25, 2021

Copy link
Copy Markdown
Contributor

No description provided.

@asherkin

Copy link
Copy Markdown
Member

Nice! This is a good interim solution and something I've been intending to add a format specifier for doing for ages.

Could you add some test cases to the test suite? (Or share a test plugin and test results here.)

@peace-maker

Copy link
Copy Markdown
Member

BigInt usually stands for some way to store any large number not restricted to 64 bits. Using Int64 might be more descriptive.

Comment thread plugins/include/string.inc Resolved
Comment thread plugins/include/string.inc Resolved
Comment thread plugins/include/string.inc Resolved
Comment thread plugins/include/string.inc Resolved
@Wend4r Wend4r changed the title Add StringToBigInt() and BigIntToString() natives Add StringToInt64() and Int64ToString() natives Jun 26, 2021
@Wend4r
Wend4r requested a review from dvander June 26, 2021 09:03
@asherkin

Copy link
Copy Markdown
Member

I wonder if Int64ToString should be a format specifier <instead / as well>? I imagine most of the use cases are going to be embedding one in a larger string such as a URL or SQL query.

@dvander

dvander commented Jun 28, 2021

Copy link
Copy Markdown
Member

I'm ambivalent. Using int64 ids as anything other than strings is a bad idea unless there's some mathematical calculation going on. As numbers they are not portable to other languages (eg JavaScript/JSON).

@asherkin
asherkin merged commit f603b7a into alliedmodders:master Jun 28, 2021
@Wend4r
Wend4r deleted the patch-3 branch June 28, 2021 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants