Skip to content

Conversation

@danwale
Copy link

@danwale danwale commented Mar 28, 2022

I added in the function #tolong to value that is larger than Int32.MaxValue to a whole number value.

I know I could have added this as a custom function but it seems like a simple change that others would benefit from.

I've added in the unit test for the function and have tested that it works as I'd expect.

My use case was I have a value that has time in seconds since EPOCH with 3 decimal places that I needed to multiply by 1000 to get to be milliseconds since epoch then I needed to convert it to a whole number, #round using 0 decimal places still returns a decimal value as well. The only workaround that wasn't ideal was to use substring and take the first 13 characters trimming off the .0 value but that then also converts the number to a string value.

I found the projects were targeting a non existent target framework of .net6.0-windows8.0, in order to work with the project I had to fix these values so that it was netstandard2.0 for the JUST.net and ExternalMethods projects but .NET 6.0 for the unit test projects. This will allow the class library to work with .NET Framework and .NET (Core) projects without issue. I've only bundled the two changes together because it was impossible to use the original target framework the projects had.

@Courela
Copy link
Contributor

Courela commented Mar 28, 2022

Compiling with .net6.0 was already 'pull requested' in #209

@danwale
Copy link
Author

danwale commented Mar 28, 2022

Yes, I just needed to repeat it because I couldn't work on the solution with that merge not completed, I didn't want to commit my changes and raise a pull request with a branch I knew wasn't working in its own right. But all good if these end up in the mainline soon.

danwale added 3 commits March 30, 2022 13:11
…er than Int32.MaxValue which previously returned 0.
…as .NET 6.0 so that the library can be used with non .NET core projects.
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.

2 participants