₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,329,106 members, 8,438,826 topics. Date: Saturday, 04 July 2026 at 04:05 AM

Toggle theme

Samyu1's Posts

Nairaland ForumSamyu1's ProfileSamyu1's Posts

1 (of 1 pages)

ProgrammingRe: How To Convert A 20-digit Numeric Value From Base10 To Base36 In C# by samyu1(op): 3:58pm On Jun 26, 2009
Both seperately i.e I tried ulong seperately and double seperately when I am using double I am not getting the same value as I expected the last 2-digits differ ex: 20090521003032797856 expected 00048MZBBINX8GIO
getting
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000048MZBBINX8G00

any way leading zeros need to be tide up

When I am using ulong I am getting integral constant is too large

Thank you
ProgrammingRe: How To Convert A 20-digit Numeric Value From Base10 To Base36 In C# by samyu1(op): 2:29pm On Jun 26, 2009
I tried ulong double and decimal everything that's not working I am getting the same problem Integral constant is too large
ProgrammingRe: How To Convert A 20-digit Numeric Value From Base10 To Base36 In C# by samyu1(op): 3:10pm On Jun 25, 2009
Thank you seun. But that doesn't work I am getting Integral constant is too large . Actually I am trying to convert this number 20090521003032796356 and expecting output as like this 00048MZBBINX8FD0.

Thank you
ProgrammingHow To Convert A 20-digit Numeric Value From Base10 To Base36 In C# by samyu1(op): 3:46pm On Jun 23, 2009
I used the following code but this has stack overflow since Int64 accepts only 18-digits and I had 20-digit lenght value which need to be converted from base10 to base36

public static string Base36Encode(long value)
{
char[] base36Chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray();
string returnValue = "";
while (value != 0)
{
returnValue = base36Chars[value % base36Chars.Length] + returnValue;
value /= 36;
}
return returnValue;
}

Any help is appreciated

Thank you in advance

1 (of 1 pages)