Skip to content

Instantly share code, notes, and snippets.

@vexx32
Last active August 13, 2018 03:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vexx32/5fe8db45c8472e882bed7cbc3b80b3ef to your computer and use it in GitHub Desktop.
Save vexx32/5fe8db45c8472e882bed7cbc3b80b3ef to your computer and use it in GitHub Desktop.
if (suffix == 'u' || suffix == 'U')
{
if (UInt32.TryParse(strNum, style, NumberFormatInfo.InvariantInfo, out uint u))
{
ulong testresult = u * (ulong) multiplier;
if (testresult > UInt32.MaxValue)
{
result = testresult;
}
else
{
result = (uint) testresult;
}
return true;
}
else
{
result = null;
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment