8 Replies Latest reply on Aug 31, 2016 4:34 AM by HimaniTanwar

# How can I convert base36 to base10?

How can I convert base36 to base10 in landesk service desk? Is there any way to achieve it through calculation?

• ###### 1. Re: How can I convert base36 to base10?

If you can right down the algorithm to do the conversion, then I'm sure boo can handle it.

• ###### 2. Re: How can I convert base36 to base10?

Not able to use Power function in calculation and also for loop iteration is also creating issues. Can you help me solving the issue?

• ###### 3. Re: How can I convert base36 to base10?

I'm afraid I don't understand what you are trying to do, so no, I don't think I can help at the moment.  Why don't you start by describing what you are trying to implement?  boo is quite similar to python so you could start by researching boo from the link shown below and python from all sorts of places on the web.

• ###### 4. Re: How can I convert base36 to base10?

I have a number in Base36 format (for example: 3FDPO56). I have to convert it to Base10 using calculations. Base10 conversion of 3FDPO56 is 7460372346.

This is what i need to achieve through calculations. Is it possible to do so in landesk service desk?

• ###### 5. Re: How can I convert base36 to base10?

I would say so yes.  Start by reading up on calculations from here:

Ivanti Service Desk and Asset Manager Calculations

• ###### 6. Re: How can I convert base36 to base10?

I am not able to use some basic functions in calculation. For example: Power function to calculate power or a number, reverse function, not able to convert character to integer. Can you help me to achieve these basic functionalities?

Thank you

• ###### 7. Re: How can I convert base36 to base10?

Hi,

This will be possible it just takes a bit of knowledge of the Boo language and .NET Framework.  For example to calculate the power of a number you can use the Math.Pow() method in .NET's Math class: Math.Pow Method (Double, Double) (System).  Boo is very capable to perform foreach and while loops: Language Guide: Loops · boo-lang/boo Wiki · GitHub.

I did a quick Google on how to convert base 36 to base 10 in .NET and found this C# example: Base36 Encoder/Decoder in C# – Not Rocket Science .  You'll just need to turn that example Decode() method into Boo code which should be simple enough.

• ###### 8. Re: How can I convert base36 to base10?

Hi,

I have written a code to convert Base36 to Base10, but it is not working.

I have created a field and added it on the window. The calculation is performed Before Save.

The code is:

import System

import System.Math

static def GetAttributeValue(Incident):

CharList = '34abcdef'

reversed = CharList.ToLower().Reverse()

result as long = 0

pos = 0

for c as char in reversed:

result += (CharList.IndexOf(c) * (Math.Pow(36, pos)))

pos += 1

return result

I am not able to use Reverse() as it states that 'Reverse is not a member of String'.

If I remove Reverse from the code then I am not able to view result on the field specified. How can I solve these issues? Please help me regarding the same.