-
1. Re: How can I convert base36 to base10?
dmshimself Aug 28, 2016 1:16 PM (in response to HimaniTanwar)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?
HimaniTanwar Aug 28, 2016 11:19 PM (in response to dmshimself)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?
dmshimself Aug 28, 2016 11:38 PM (in response to HimaniTanwar)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?
HimaniTanwar Aug 28, 2016 11:44 PM (in response to dmshimself)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?
dmshimself Aug 29, 2016 1:37 PM (in response to HimaniTanwar)I would say so yes. Start by reading up on calculations from here:
-
6. Re: How can I convert base36 to base10?
HimaniTanwar Aug 30, 2016 3:50 AM (in response to dmshimself)Thank you. Your reply is much appreciated.
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?
Stu McNeill Aug 30, 2016 8:06 AM (in response to HimaniTanwar)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?
HimaniTanwar Aug 31, 2016 4:34 AM (in response to Stu McNeill)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.